Fix pop_queue for move object twice
With the two vector timestamp change some resolution was lost in the queue entries that could lead to the reconciler being unable to successfully remove a processed item from the queue in pop_queue. To ensure the queue entries with a significant offset can be successfully removed while still handling the re-enqueued object case issue the DELETE with the timestamp slightly later than the maximum of the queue entries last modified time (q_record) and misplaced objects timestamp (q_ts). Change-Id: I4726243b3f7c4c1e98f0c578e7ffdecf4ec22199
This commit is contained in:
parent
0a5b003345
commit
8a3b65107d
@ -372,7 +372,7 @@ class ContainerReconciler(Daemon):
|
||||
an object was manually re-enqued.
|
||||
"""
|
||||
q_path = '/%s/%s/%s' % (MISPLACED_OBJECTS_ACCOUNT, container, obj)
|
||||
x_timestamp = slightly_later_timestamp(q_record)
|
||||
x_timestamp = slightly_later_timestamp(max(q_record, q_ts))
|
||||
self.stats_log('pop_queue', 'remove %r (%f) from the queue (%s)',
|
||||
q_path, q_ts, x_timestamp)
|
||||
headers = {'X-Timestamp': x_timestamp}
|
||||
|
@ -586,6 +586,13 @@ class TestContainerMergePolicyIndex(unittest.TestCase):
|
||||
acceptable_statuses=(4,),
|
||||
headers={'X-Backend-Storage-Policy-Index': int(old_policy)})
|
||||
|
||||
# make sure the queue is settled
|
||||
get_to_final_state()
|
||||
for container in client.iter_containers('.misplaced_objects'):
|
||||
for obj in client.iter_objects('.misplaced_objects',
|
||||
container['name']):
|
||||
self.fail('Found unexpected object %r in the queue' % obj)
|
||||
|
||||
|
||||
def main():
|
||||
options, commands = parser.parse_args()
|
||||
|
Loading…
x
Reference in New Issue
Block a user