relinker did not cleanup tombstones, causes EEXIST errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Committed
|
Undecided
|
Alistair Coles |
Bug Description
With this change https:/
This unit test illustrates (patch to commit b8aefd750)
diff --git a/test/
index cd438d1e8.
--- a/test/
+++ b/test/
@@ -943,6 +943,7 @@ class TestRelinker(
]))
+ self.assertFals
def test_cleanup_
# relink a tombstone
@@ -973,6 +974,32 @@ class TestRelinker(
# want self.objname around polluting the old partition space.
+ def test_cleanup_
+ # relink a tombstone
+ fname_ts = self.objname[:-4] + "ts"
+ os.rename(
+ self.objname = fname_ts
+ self.expected_file = self.expected_
+ self._common_
+ self.assertTrue
+
+ with mock.patch.
+ return_
+ self.assertEqual(0, relinker.main([
+ 'cleanup',
+ '--swift-dir', self.testdir,
+ '--devices', self.devices,
+ '--skip-mount',
+ ]))
+ self.assertEqua
+ self.assertEqua
+
+ # we do want the tombstone in the new partition space
+ self.assertTrue
+ # we definitely *don't* want self.objname around polluting the old
+ # partition space.
+ self.assertFals
+
def test_cleanup_
This was fixed by https:/
This then results in error logs when conducting a subsequent partition power increase, due to the scenarios below, such as:
"Relinking path/to/
(notation in following: "PN location" refers to "the expected location an object when partition power is N")
During the previous part-power increase (for example from 16 to 17), some tombstones were not cleaned up from their P16 location. The same tombstones did have links created in their P17 locations.
After the completion of the 16->17 part-power increase, the misplaced tombstones from P16 locations were replicated to devices on which there were also tombstones in P17 locations. The tombstones in P16 would also exist elsewhere but the error logs would only manifest for devices on which both the P16 and P17 partitions are placed.
Because they were replicated, the P16 tombstones have different inodes than the P17 tombstones on the same device.
During the next part power increase (in tis example, from 17 to 18), the relinker visits partitions on a device in reverse order, so finds the P17 tombstones first and links them to their new P18 locations. For example a tombstone in part 96000 would be linked to a tombstone in part 192000.
Assume the P17 partition is < 2^16, so that the P18 partition IS NOT rehashed after relinking.
The relinker moves on to find the P16 tombstones, and attempts to relink those to their P18 locations. For example a tombstone in part 48000 would be linked to part 192000. However, the P18 location already has a link to the P17 location, so the attempt to link to the P16 location fails.
The inode linked from P18 is different from the inode in P16, so the failure to relink P16 to P18 is logged as an EEXIST error.
Inspection of the device after the first pass of the relinker will show that there is a tombstone in all three locations P16, P17 and P18, with P17 and P18 having the same inode.
The required files are intact, but the same error will be logged if the relinker makes further passes over the same device.
Changed in swift: | |
status: | In Progress → Fix Committed |
https:/ /review. opendev. org/c/openstack /swift/ +/783467