Stop asserting exact location-version-id equality after replication - #2479
Stop asserting exact location-version-id equality after replication#2479delthas wants to merge 2 commits into
Conversation
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Replication is at-least-once, so the destination version id stamped into
source metadata is not guaranteed to be the version that ends up current
at the destination.
One census run hit that: two oplog populators were alive during a rolling
restart and each allocated a Kafka-Connect connector for the same bucket,
so the object was replicated twice. The status processor kept the first
stamp ("entry replication is already COMPLETED for this location,
skipping metadata update") while the destination kept the version written
by the second replication, and the assertion failed on two objects that
were present and identical in content.
Assert on content instead: compare ETags, normalising the surrounding
quotes the way get-object-attributes.ts already does, and require only
that the version-id stamp is present. Every destination in this feature
is AWS or CRR loopback and the objects are single-part, so the ETags are
comparable MD5s.
Issue: ZENKO-5339
d1a334e to
3af16d4
Compare
SylvainSenechal
left a comment
There was a problem hiding this comment.
Ok for me although when you say this :
"What it caught. In one census run the object was replicated twice: two oplog populators were alive during a rolling restart and each allocated a Kafka-Connect connector for the same bucket, producing three entries for one source version" :
- It would be nice to at least have a ticket to think about this behavior, and decide if its an acceptable design or if its possible to fix it on the backbeat side
- I think i would still keep the versionID assertion, and maybe when they are not equal, instead of failing the test, log a warning "test replication find non matching version ID likely due to backbeat oplog populator restarts..."
Review feedback: keep comparing the stamped <location>-version-id against the destination's current version, but log a warning rather than failing, so the signal stays visible without failing on behaviour the product is allowed to have. The warning names the likely cause, since it is not obvious from the assertion alone: the object was replicated more than once, for instance by two oplog populators both allocating a connector for the same bucket after a restart, after which the status processor keeps the first stamp and the destination keeps the later version. Issue: ZENKO-5339
|
Both points done. Version-id check kept as a warning ( That keeps the signal visible without failing on something at-least-once replication is allowed to do. Ticket filed: BB-834, for the populator behaviour itself — fence bucket-to-connector ownership so a terminating and a starting instance cannot both allocate the same bucket. It records the traced occurrence (three replication entries for one source version, the status processor dropping the second stamp with "already COMPLETED for this location, skipping metadata update"), and explicitly notes that after this PR a mismatch no longer fails CI, so nothing will catch it regressing. Suggested looking at it together with the populator's scan/watch ordering hole, since both are about ownership across a restart. Worth adding for context: the later 30-run census did not reproduce it, so there is no rate estimate beyond that single occurrence. The trigger is rollout frequency, which in CI is inflated by the operator re-rendering every backbeat deployment on each location CRUD (ZKOP-568). |
DarkIsDude
left a comment
There was a problem hiding this comment.
Same as Sylvain. I'm not sure it's the right approach. We should fix that in backbeat instead of here and keep the hard comparison here (it's what we want finally). Or it's a product decision and we are align with it, then your fix is the right one (but it seems not the case, at least in the scenario tested where one replication should happens), or it's not and we should fix it in backbeat.
Moreover, I would approve this PR if the occurence is high enough to be painful. Seems not the case regarding your last comment (30 runs didn't reproduce it).
We can also ask to the team what do they think, but IMO it's not the right approach here.
|
@delthas also in your ticket https://scality.atlassian.net/browse/BB-834 add a link to this thread to have the full context ? |
|
@DarkIsDude you're right on the frequency, and I checked rather than assumed. The single occurrence came from one census run ( Closing in favour of BB-834. |
|
Also I linked the thread in the ticket. |
The
Bucket Replication location strippingscenario asserted that the<location>-version-idstamped in source metadata equals the destination's current version id. Replication is at-least-once, so that is not an invariant the product offers, and the test fails on correct behaviour.What it caught. In one census run the object was replicated twice: two oplog populators were alive during a rolling restart and each allocated a Kafka-Connect connector for the same bucket, producing three entries for one source version. The status processor kept the first stamp — "entry replication is already COMPLETED for this location, skipping metadata update" — while the destination retained the version written by the second replication. Both objects were present and identical in content; only the recorded version id disagreed. Replication itself had succeeded, in 59 s.
The change. Assert on content rather than identity: compare ETags (normalising the surrounding quotes, as
get-object-attributes.ts:68already does) and require only that the version-id stamp is present.ContentLengthwas already compared. The neighbouringscal-version-id,scal-replication-statusand<location>-replication-statusassertions are untouched —scal-version-idrecords the source version, which both copies share, so the double replication does not affect it.Census confirmation. Across the two 30-run censuses since:
Issue: ZENKO-5339