OpenStack Object Storage (Swift)

Container sync doesn't sync last rowid

Reported by Dan Hersam on 2012-11-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Undecided
Dan Hersam

Bug Description

Occasionally an object won't get synced to the remote container. This happens most often when one of the object servers is down. No matter how many times container sync runs, it doesn't send the last remaining object to be synced. The problem would resolve itself as soon as a new object was added to the container.

The reason for the behavior is this code:

if row['ROWID'] >= sync_point1:
                        break

Instead of updating the last rowid, the code breaks, leaving sync_point2 one less than sync_point1 and continually entering the first "all updates" while loop on each subsequent run.

The proposed fix is :

if row['ROWID'] > sync_point1:
                        break

By only breaking if the rowid is greater than sync_point1, the last row is synced and sync_point2 is updated to be equal to sync_point1.

This unit test comment seems to imply an expected deviation that does not result in a container sync: "Succeeds because the two sync points haven't deviated enough yet." If that's the case, the last object still needs to be synced. If not, we can fix the test case by making the FakeContainerBroker's syncpoints equal.

I can add the code change once my request to join Swift Contributors is approved.

Swift 1.7.5

Fix proposed to branch: master
Review: https://review.openstack.org/16491

Changed in swift:
assignee: nobody → Dan Hersam (dhersam)
status: New → In Progress

Reviewed: https://review.openstack.org/16491
Committed: http://github.com/openstack/swift/commit/923b8b95c3ea46b5ad017690752a24f4f4e10f8a
Submitter: Jenkins
Branch: master

commit 923b8b95c3ea46b5ad017690752a24f4f4e10f8a
Author: Dan Hersam <email address hidden>
Date: Fri Nov 16 18:51:22 2012 +0000

    Fix for container sync not syncing last rowid

    Bug 1079439

    Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-01-18
Changed in swift:
milestone: none → 1.7.6
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers