Stop asserting exact location-version-id equality after replication - #2479
Draft
delthas wants to merge 1 commit into
Draft
Stop asserting exact location-version-id equality after replication#2479delthas wants to merge 1 commit into
delthas wants to merge 1 commit into
Conversation
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
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One failure in the recent CTST flakiness census, in
Bucket Replication location stripping(4 MiB row). Replication itself succeeded, in 59 s — the failure was the assertion that follows it.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 (three entries for one source version). The replication status processor then discarded the newer stamp, logging "entry replication is already COMPLETED for this location, skipping metadata update", which left a stale
<location>-version-idin source metadata while the destination retained the version written by the later replication. Both objects were present and identical in content; only the recorded version id disagreed.Replication is at-least-once by design, so that stamp is not guaranteed to name the version that ends up current at the destination. Asserting strict equality asserts an invariant the product does not offer, which makes the test fail on correct behaviour.
So the assertion now covers content rather than identity: ETags are compared (normalising the surrounding quotes the same way
get-object-attributes.ts:68already does, since the CLI and the SDK disagree on whether they are kept), and the version-id stamp only has to be 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 it is unaffected by the double replication.Checked before adding the ETag comparison: every destination this feature configures is
awsbackend,awsbackendmismatchor a CRR loopback location, and the objects are 0–4 MiB single-part uploads, so the ETags are comparable MD5s. No Azure or GCP destination is involved, where that would not hold.Two oplog populators concurrently owning the same bucket during rollover is a product wart worth fencing separately; it has no ticket yet and is out of scope here.
Issue: ZENKO-5339