From b0cb7aaf04eff033a329e017a8628c84a62e33cd Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Sat, 27 Oct 2012 00:10:47 -0400 Subject: object-storage: remove glusterfs filter requirement Fixes https://bugzilla.redhat.com/show_bug.cgi?id=870589 Remove the Glusterfs object, transforming it into a module providing module data fields (like swift.common.constraints) and module methods for mounting/unmounting and access the gluster volume information. As a result, we can then remove the glusterfs filter from the pipeline since we no longer need to provide the Glusterfs object through all the plugin code paths. This is one more step closer to removing our dependency on modifying the Swift code directly with these changes. See It is also the first step to acknowledging that we are not a plugin, but a layering on top of Swift. The major piece of work here is based on a recognition that the plugins/Glusterfs.py module provided a Glusterfs class that instantiated instances of an object that always contained the same data from the configuration file. The fields of such an object were not being changed and were treated as read-only in all cases. Since the object's data was the same for all instantiations there was no need to pass the data from the glusterfs filter all the way down into the bowels of the Gluster_DiskFile and DiskDir objects. Taking advantage of the nature of that data, we now just have those fields read into module variables, and change the Glusterfs object methods into module level functions. Much of the changes result from the consequence of making that switch from object to module. Here are a few other changes made along the way: * Bump the release numbers in the spec files in recognition of these changes * Create the plugins/fs_utils.py module so that the methods in the plugins/Glusterfs.py module don't have to include plugins/utils.py, which would create a circular dependency * Note that this dependency comes from methods in plugins/utils.py depending on the module level constructs in plugins/Glusterfs.py so that we only store those values in one place * Changed plugins/DiskDir.py:DiskDir class to not check for, and/or optionally create, the /etc/swift/db_file.db at run time, just create it a module init time * Removed the duplicate strip_obj_storage_path() from plugins/DiskDir.py and utils.py and move it to the Glusterfs module * Used os.path.join in plugins/DiskDir.py where possible * Renamed the .conf files to .conf-gluster so that we don't clobber existing config files * This is not a complete change, as the spec file also needs to be modified to avoid the clobbering * See also https://bugzilla.redhat.com/show_bug.cgi?id=865867 * Removed the redundant DIR_TYPE definition in plugins/utils.py * Removed MOUNT_PATH from plugins/utils.py replacing references with that from Glusterfs * This actually fixes a bug if a user every used a different mount path from the default in fs.conf * Added ASYNCDIR definition to plugins/utils.py until such time as another refactoring can rely on the one from swift.obj.server * Renamed plugins/utils.py's plugin_enabled() function to Gluster_enabled() * The diffs we carry for Swift are now a bit smaller in that we no longer have to add the plugin() method, we don't have to keep a fs_object field in these objects, and we can reference the Glusterfs module directly * Unit tests were modified appropriately, but now need to be run in the context of a Swift tree; this is unfortunate, but further refactoring will address this Change-Id: Id5d2510d56364761c03b3979bc71187dbe2f82fe BUG: 870589 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4141 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Mohammed Junaid Tested-by: Kaleb KEITHLEY --- swift/1.4.8/plugins/conf/account-server/1.conf | 22 ------ .../plugins/conf/account-server/1.conf-gluster | 19 +++++ swift/1.4.8/plugins/conf/container-server/1.conf | 24 ------ .../plugins/conf/container-server/1.conf-gluster | 21 +++++ swift/1.4.8/plugins/conf/fs.conf | 9 --- swift/1.4.8/plugins/conf/fs.conf-gluster | 9 +++ swift/1.4.8/plugins/conf/object-server/1.conf | 22 ------ .../plugins/conf/object-server/1.conf-gluster | 19 +++++ swift/1.4.8/plugins/conf/proxy-server.conf | 24 ------ swift/1.4.8/plugins/conf/proxy-server.conf-gluster | 24 ++++++ swift/1.4.8/plugins/conf/swift.conf | 92 ---------------------- swift/1.4.8/plugins/conf/swift.conf-gluster | 92 ++++++++++++++++++++++ 12 files changed, 184 insertions(+), 193 deletions(-) delete mode 100644 swift/1.4.8/plugins/conf/account-server/1.conf create mode 100644 swift/1.4.8/plugins/conf/account-server/1.conf-gluster delete mode 100644 swift/1.4.8/plugins/conf/container-server/1.conf create mode 100644 swift/1.4.8/plugins/conf/container-server/1.conf-gluster delete mode 100644 swift/1.4.8/plugins/conf/fs.conf create mode 100644 swift/1.4.8/plugins/conf/fs.conf-gluster delete mode 100644 swift/1.4.8/plugins/conf/object-server/1.conf create mode 100644 swift/1.4.8/plugins/conf/object-server/1.conf-gluster delete mode 100644 swift/1.4.8/plugins/conf/proxy-server.conf create mode 100644 swift/1.4.8/plugins/conf/proxy-server.conf-gluster delete mode 100644 swift/1.4.8/plugins/conf/swift.conf create mode 100644 swift/1.4.8/plugins/conf/swift.conf-gluster (limited to 'swift/1.4.8/plugins/conf') diff --git a/swift/1.4.8/plugins/conf/account-server/1.conf b/swift/1.4.8/plugins/conf/account-server/1.conf deleted file mode 100644 index a82bc35eaa4..00000000000 --- a/swift/1.4.8/plugins/conf/account-server/1.conf +++ /dev/null @@ -1,22 +0,0 @@ -[DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6012 -user = root -log_facility = LOG_LOCAL2 - -[pipeline:main] -pipeline = glusterfs account-server - -[app:account-server] -use = egg:swift#account - -[filter:glusterfs] -use = egg:swift#glusterfs - -[account-replicator] -vm_test_mode = yes - -[account-auditor] - -[account-reaper] diff --git a/swift/1.4.8/plugins/conf/account-server/1.conf-gluster b/swift/1.4.8/plugins/conf/account-server/1.conf-gluster new file mode 100644 index 00000000000..911e2837f50 --- /dev/null +++ b/swift/1.4.8/plugins/conf/account-server/1.conf-gluster @@ -0,0 +1,19 @@ +[DEFAULT] +devices = /srv/1/node +mount_check = false +bind_port = 6012 +user = root +log_facility = LOG_LOCAL2 + +[pipeline:main] +pipeline = account-server + +[app:account-server] +use = egg:swift#account + +[account-replicator] +vm_test_mode = yes + +[account-auditor] + +[account-reaper] diff --git a/swift/1.4.8/plugins/conf/container-server/1.conf b/swift/1.4.8/plugins/conf/container-server/1.conf deleted file mode 100644 index e6d313c3872..00000000000 --- a/swift/1.4.8/plugins/conf/container-server/1.conf +++ /dev/null @@ -1,24 +0,0 @@ -[DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6011 -user = root -log_facility = LOG_LOCAL2 - -[pipeline:main] -pipeline = glusterfs container-server - -[app:container-server] -use = egg:swift#container - -[filter:glusterfs] -use = egg:swift#glusterfs - -[container-replicator] -vm_test_mode = yes - -[container-updater] - -[container-auditor] - -[container-sync] diff --git a/swift/1.4.8/plugins/conf/container-server/1.conf-gluster b/swift/1.4.8/plugins/conf/container-server/1.conf-gluster new file mode 100644 index 00000000000..eb5650afa74 --- /dev/null +++ b/swift/1.4.8/plugins/conf/container-server/1.conf-gluster @@ -0,0 +1,21 @@ +[DEFAULT] +devices = /srv/1/node +mount_check = false +bind_port = 6011 +user = root +log_facility = LOG_LOCAL2 + +[pipeline:main] +pipeline = container-server + +[app:container-server] +use = egg:swift#container + +[container-replicator] +vm_test_mode = yes + +[container-updater] + +[container-auditor] + +[container-sync] diff --git a/swift/1.4.8/plugins/conf/fs.conf b/swift/1.4.8/plugins/conf/fs.conf deleted file mode 100644 index b6ec5121f9f..00000000000 --- a/swift/1.4.8/plugins/conf/fs.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -mount_path = /mnt/gluster-object -auth_account = auth -#ip of the fs server. -mount_ip = localhost -#fs server need not be local, remote server can also be used, -#set remote_cluster=yes for using remote server. -remote_cluster = no -object_only = no \ No newline at end of file diff --git a/swift/1.4.8/plugins/conf/fs.conf-gluster b/swift/1.4.8/plugins/conf/fs.conf-gluster new file mode 100644 index 00000000000..b6ec5121f9f --- /dev/null +++ b/swift/1.4.8/plugins/conf/fs.conf-gluster @@ -0,0 +1,9 @@ +[DEFAULT] +mount_path = /mnt/gluster-object +auth_account = auth +#ip of the fs server. +mount_ip = localhost +#fs server need not be local, remote server can also be used, +#set remote_cluster=yes for using remote server. +remote_cluster = no +object_only = no \ No newline at end of file diff --git a/swift/1.4.8/plugins/conf/object-server/1.conf b/swift/1.4.8/plugins/conf/object-server/1.conf deleted file mode 100644 index 665aa94be8b..00000000000 --- a/swift/1.4.8/plugins/conf/object-server/1.conf +++ /dev/null @@ -1,22 +0,0 @@ -[DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6010 -user = root -log_facility = LOG_LOCAL2 - -[pipeline:main] -pipeline = glusterfs object-server - -[app:object-server] -use = egg:swift#object - -[filter:glusterfs] -use = egg:swift#glusterfs - -[object-replicator] -vm_test_mode = yes - -[object-updater] - -[object-auditor] diff --git a/swift/1.4.8/plugins/conf/object-server/1.conf-gluster b/swift/1.4.8/plugins/conf/object-server/1.conf-gluster new file mode 100644 index 00000000000..13dda69bae2 --- /dev/null +++ b/swift/1.4.8/plugins/conf/object-server/1.conf-gluster @@ -0,0 +1,19 @@ +[DEFAULT] +devices = /srv/1/node +mount_check = false +bind_port = 6010 +user = root +log_facility = LOG_LOCAL2 + +[pipeline:main] +pipeline = object-server + +[app:object-server] +use = egg:swift#object + +[object-replicator] +vm_test_mode = yes + +[object-updater] + +[object-auditor] diff --git a/swift/1.4.8/plugins/conf/proxy-server.conf b/swift/1.4.8/plugins/conf/proxy-server.conf deleted file mode 100644 index 9bec6425355..00000000000 --- a/swift/1.4.8/plugins/conf/proxy-server.conf +++ /dev/null @@ -1,24 +0,0 @@ -[DEFAULT] -bind_port = 8080 -user = root -log_facility = LOG_LOCAL1 - -[pipeline:main] -pipeline = healthcheck cache tempauth gluster proxy-server - -[app:proxy-server] -use = egg:swift#proxy -allow_account_management = true -account_autocreate = true - -[filter:tempauth] -use = egg:swift#tempauth - -[filter:healthcheck] -use = egg:swift#healthcheck - -[filter:cache] -use = egg:swift#memcache - -[filter:gluster] -use = egg:swift#gluster \ No newline at end of file diff --git a/swift/1.4.8/plugins/conf/proxy-server.conf-gluster b/swift/1.4.8/plugins/conf/proxy-server.conf-gluster new file mode 100644 index 00000000000..9bec6425355 --- /dev/null +++ b/swift/1.4.8/plugins/conf/proxy-server.conf-gluster @@ -0,0 +1,24 @@ +[DEFAULT] +bind_port = 8080 +user = root +log_facility = LOG_LOCAL1 + +[pipeline:main] +pipeline = healthcheck cache tempauth gluster proxy-server + +[app:proxy-server] +use = egg:swift#proxy +allow_account_management = true +account_autocreate = true + +[filter:tempauth] +use = egg:swift#tempauth + +[filter:healthcheck] +use = egg:swift#healthcheck + +[filter:cache] +use = egg:swift#memcache + +[filter:gluster] +use = egg:swift#gluster \ No newline at end of file diff --git a/swift/1.4.8/plugins/conf/swift.conf b/swift/1.4.8/plugins/conf/swift.conf deleted file mode 100644 index e506b6f54a8..00000000000 --- a/swift/1.4.8/plugins/conf/swift.conf +++ /dev/null @@ -1,92 +0,0 @@ -[DEFAULT] -Enable_plugin = yes - - -[swift-hash] -# random unique string that can never change (DO NOT LOSE) -swift_hash_path_suffix = gluster - - -# The swift-constraints section sets the basic constraints on data -# saved in the swift cluster. - -[swift-constraints] - -# max_file_size is the largest "normal" object that can be saved in -# the cluster. This is also the limit on the size of each segment of -# a "large" object when using the large object manifest support. -# This value is set in bytes. Setting it to lower than 1MiB will cause -# some tests to fail. It is STRONGLY recommended to leave this value at -# the default (5 * 2**30 + 2). - -# FIXME: Really? Gluster can handle a 2^64 sized file? And can the fronting -# web service handle such a size? I think with UFO, we need to keep with the -# default size from Swift and encourage users to research what size their web -# services infrastructure can handle. - -max_file_size = 18446744073709551616 - - -# max_meta_name_length is the max number of bytes in the utf8 encoding -# of the name portion of a metadata header. - -#max_meta_name_length = 128 - - -# max_meta_value_length is the max number of bytes in the utf8 encoding -# of a metadata value - -#max_meta_value_length = 256 - - -# max_meta_count is the max number of metadata keys that can be stored -# on a single account, container, or object - -#max_meta_count = 90 - - -# max_meta_overall_size is the max number of bytes in the utf8 encoding -# of the metadata (keys + values) - -#max_meta_overall_size = 4096 - - -# max_object_name_length is the max number of bytes in the utf8 encoding of an -# object name: Gluster FS can handle much longer file names, but the length -# between the slashes of the URL is handled below. Remember that most web -# clients can't handle anything greater than 2048, and those that do are -# rather clumsy. - -max_object_name_length = 2048 - -# max_object_name_component_length (GlusterFS) is the max number of bytes in -# the utf8 encoding of an object name component (the part between the -# slashes); this is a limit imposed by the underlying file system (for XFS it -# is 255 bytes). - -max_object_name_component_length = 255 - -# container_listing_limit is the default (and max) number of items -# returned for a container listing request - -#container_listing_limit = 10000 - - -# account_listing_limit is the default (and max) number of items returned -# for an account listing request - -#account_listing_limit = 10000 - - -# max_account_name_length is the max number of bytes in the utf8 encoding of -# an account name: Gluster FS Filename limit (XFS limit?), must be the same -# size as max_object_name_component_length above. - -max_account_name_length = 255 - - -# max_container_name_length is the max number of bytes in the utf8 encoding -# of a container name: Gluster FS Filename limit (XFS limit?), must be the same -# size as max_object_name_component_length above. - -max_container_name_length = 255 diff --git a/swift/1.4.8/plugins/conf/swift.conf-gluster b/swift/1.4.8/plugins/conf/swift.conf-gluster new file mode 100644 index 00000000000..e506b6f54a8 --- /dev/null +++ b/swift/1.4.8/plugins/conf/swift.conf-gluster @@ -0,0 +1,92 @@ +[DEFAULT] +Enable_plugin = yes + + +[swift-hash] +# random unique string that can never change (DO NOT LOSE) +swift_hash_path_suffix = gluster + + +# The swift-constraints section sets the basic constraints on data +# saved in the swift cluster. + +[swift-constraints] + +# max_file_size is the largest "normal" object that can be saved in +# the cluster. This is also the limit on the size of each segment of +# a "large" object when using the large object manifest support. +# This value is set in bytes. Setting it to lower than 1MiB will cause +# some tests to fail. It is STRONGLY recommended to leave this value at +# the default (5 * 2**30 + 2). + +# FIXME: Really? Gluster can handle a 2^64 sized file? And can the fronting +# web service handle such a size? I think with UFO, we need to keep with the +# default size from Swift and encourage users to research what size their web +# services infrastructure can handle. + +max_file_size = 18446744073709551616 + + +# max_meta_name_length is the max number of bytes in the utf8 encoding +# of the name portion of a metadata header. + +#max_meta_name_length = 128 + + +# max_meta_value_length is the max number of bytes in the utf8 encoding +# of a metadata value + +#max_meta_value_length = 256 + + +# max_meta_count is the max number of metadata keys that can be stored +# on a single account, container, or object + +#max_meta_count = 90 + + +# max_meta_overall_size is the max number of bytes in the utf8 encoding +# of the metadata (keys + values) + +#max_meta_overall_size = 4096 + + +# max_object_name_length is the max number of bytes in the utf8 encoding of an +# object name: Gluster FS can handle much longer file names, but the length +# between the slashes of the URL is handled below. Remember that most web +# clients can't handle anything greater than 2048, and those that do are +# rather clumsy. + +max_object_name_length = 2048 + +# max_object_name_component_length (GlusterFS) is the max number of bytes in +# the utf8 encoding of an object name component (the part between the +# slashes); this is a limit imposed by the underlying file system (for XFS it +# is 255 bytes). + +max_object_name_component_length = 255 + +# container_listing_limit is the default (and max) number of items +# returned for a container listing request + +#container_listing_limit = 10000 + + +# account_listing_limit is the default (and max) number of items returned +# for an account listing request + +#account_listing_limit = 10000 + + +# max_account_name_length is the max number of bytes in the utf8 encoding of +# an account name: Gluster FS Filename limit (XFS limit?), must be the same +# size as max_object_name_component_length above. + +max_account_name_length = 255 + + +# max_container_name_length is the max number of bytes in the utf8 encoding +# of a container name: Gluster FS Filename limit (XFS limit?), must be the same +# size as max_object_name_component_length above. + +max_container_name_length = 255 -- cgit