`interval` setting is inconsistent between db replicators and object replicator

Bug #1669525 reported by Tim Burke
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Confirmed
Low
Unassigned

Bug Description

Not sure which way it *should* behave, but the object replicator will always sleep for `interval` after each cycle [1] while the account/container replicators will sleep for `interval - elapsed`, and only if `interval > elapsed`. As a direct descendant, the reconstructor behaves like the object replicator [3]. These should probably be consistent.

FWIW, it looks like the db replicators used to behave like the object one [4] -- not sure on the justification, though.

[1] https://github.com/openstack/swift/blob/2.13.0/swift/obj/replicator.py#L828
[2] https://github.com/openstack/swift/blob/2.13.0/swift/common/db_replicator.py#L681-L682
[3] https://github.com/openstack/swift/blob/2.13.0/swift/obj/reconstructor.py#L1017
[4] https://github.com/openstack/swift/commit/52ba08d

Revision history for this message
clayg (clay-gerrard) wrote :

I think it all went south here:

https://review.openstack.org/#/c/171170/

Pete was right, we shouldn't call two things interval that do two different things.

Christian was right, run_pause or interval are both reasonable and orthogonal options.

I think all daemons should have both:

sleep(max(run_pause, interval - elapsed))

I *personally* would run with:

run_pause = 0
interval = 30

But if you prefer a little-bit of sleep regardless and no fast cycles, you should be welcome to

run_pause = 30
interval = 300

The real question is how to detangle it now. Do we need some crufty code when the conf doesn't have both to default to one or the other depending on what the current implementation was currently doing and then *documenting* that?

I'd much rather just consider the inconsequential behavior difference a *bug* - add config options for both with reasonable defaults - document the new consistent behavior - and throw a ling in the Changelog.

tags: added: low-hanging-fruit
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.