summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.le-disez@corp.ovh.com>2019-11-14 16:26:48 -0500
committerRomain LE DISEZ <romain.le-disez@corp.ovh.com>2020-03-31 17:33:06 -0400
commit3061ec803f1bf11ba88d8eaec96db2c007307c3a (patch)
treecf4a6f820ed25e241d0ae12ce579b256eefc3a25 /bin
parent742835a6ec12944f606d6cd65ca7f18fdf78a09c (diff)
downloadswift-3061ec803f1bf11ba88d8eaec96db2c007307c3a.tar.gz
relinker: Improve performance by limiting I/O
This commit reduce the number of I/O done by the swift-object-relinker. First, it saves a progress state of relinking and cleanup in case the process is interrupted during the operation. This allow to resume operation without rescanning all partitions. Secondly, it prevents from being scanned by relink and cleanup all partitions that are bigger than 2^part_power (or (2^next_part_power)/2). These partitions were not existing before the beginning of the part_power increase, so there is nothing to relink or cleanup. Thirdly, it reverse-orders the partitions to scan so that some useless work is avoided. If a device contains partitions 1 and 3, relinking partition 1 will create "new" objects in partition 3, that will need to be scanned when the relinker will work on partition 3. It is useless. If partition 3 is done first, it will only contain the objects that need to be relinked. Fourthly, it allows to specify a unique device to work on. To do that, some hooks were added in audit_location_generator to allow to execute some custom code before/after iterating a device/partition/suffix/hash. Change-Id: If1bf8ed9036fb0ec619b0d4f16061a81a1af2082
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift-object-relinker2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/swift-object-relinker b/bin/swift-object-relinker
index 0712ea769..7afd7b873 100755
--- a/bin/swift-object-relinker
+++ b/bin/swift-object-relinker
@@ -28,6 +28,8 @@ if __name__ == '__main__':
dest='swift_dir', help='Path to swift directory')
parser.add_argument('--devices', default='/srv/node',
dest='devices', help='Path to swift device directory')
+ parser.add_argument('--device', default=None, dest='device',
+ help='Device name to relink (default: all)')
parser.add_argument('--skip-mount-check', default=False,
help='Don\'t test if disk is mounted',
action="store_true", dest='skip_mount_check')