Never garbage-collect data on an isCRR location - #2828
Conversation
Hello francoisferrand,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 2 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.6 #2828 +/- ##
===================================================
- Coverage 75.77% 75.54% -0.24%
===================================================
Files 200 201 +1
Lines 13922 13934 +12
===================================================
- Hits 10549 10526 -23
- Misses 3363 3398 +35
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Data sitting on an isCRR location is production data owned by a remote site: we may read it, but deleting it is never ours to do. The copy engine reuses the lifecycle transition pipeline, which garbage-collects the from-location once the new one is merged into the metadata - against an isCRR source that would wipe the remote production copy. Unlike a transition, a localization merge must therefore leave the from-location alone. Keying this on the location type rather than making it a clean-room special case also gives us replay safety for duplicate copy actions: the second merge supersedes the first and collects its copy, which is only safe because the first never touched the remote source. Issue: BB-813
Same no-GC rule as in the copy engine, applied where data actually gets deleted: whatever published the deleteData action, parts living on an isCRR location are remote production data and get skipped rather than deleted. That covers every publisher, notably restored-object expiration, where expiring a clean-room object that was never localized would otherwise delete the production copy. Reaching the GC service with such a location means something upstream is wrong, so it warns, but deleting is never the right answer: the entry is still completed and the offset committed, and no completion metric is emitted for a delete that did not happen. Issue: BB-818
750b874 to
c5a5e88
Compare
All parts of an object version live on the same location, so filtering the location list part by part, and handling a mix of CRR and local parts, was solving a problem that cannot happen. Reduce the helper to a plain isCRRLocation() lookup and make both call sites skip the whole action when the data being collected sits on such a location. Keyed on the dataStoreName of the parts rather than the object storage class: on the transition rollback paths we collect the freshly written local copy while the source storage class still points at the old, possibly remote, location. Issue: BB-813
|
Note on the red checks, neither is caused by this branch:
Everything else is green. |
Now fixed, rebase and enjoy :) |
Data on an `isCRR` location belongs to a remote site: it may be read, but never deleted, and a version whose data still lives there has not been localized yet. Several places need to ask that question. Lifted verbatim from BB-813 (#2828), which introduces the same helper and carries its unit test and the location fixture. Kept byte-identical so that whichever branch lands second has this commit dropped as already applied, rather than conflicting. Issue: BB-811
Data living on an
isCRRlocation is production data owned by a remote site. We may read it (that is the whole point of localizing a clean room object), but we must never delete it. That is a general rule keyed on the location type, not a clean room conditional and not behind a config flag.It needs to hold at two independent points, one commit each:
BB-813 - do not trigger the GC. The copy engine reuses the lifecycle transition pipeline:
CopyLocationTaskcopies the data locally, thenLifecycleUpdateTransitionTaskmerges the new location into the metadata and publishes adeleteDataaction for the old one. Against anisCRRsource that would wipe the remote production copy, so unlike a transition, the localization merge leaves the from-location alone and publishes nothing when there is nothing left to collect. This also gives us replay safety for duplicate copy actions: the second merge supersedes the first and collects its copy, which is only safe because the first never touched the remote source.BB-818 - guard the GC service. The same rule applied where data actually gets deleted, per location part, whatever published the action. It matters on its own: restored-object expiration goes through a different publisher, so expiring a clean room object that was never localized would otherwise delete the production copy. Reaching the GC service with an
isCRRlocation means something upstream is wrong, so it warns, but deleting is never the right answer - the entry is still completed and the offset committed, and no completion metric is emitted for a delete that did not happen.The two share a small
lib/util/locations.jshelper, which is why they are in one PR rather than two.This is a prerequisite for BB-814 (#2826), which is what starts publishing
copyLocationactions for clean room objects; it should not be enabled in a real clean room without this. There is no code dependency on that branch though - the two are independent apart from the sharedlocation-crr-sourcetest fixture, which is byte-identical on both.One test-only side effect worth flagging: adding a location to the
conf/locationConfig.jsonfixture breaks aCircuitBreakerGroupcase that deep-compares a probe array built from every location, so its expectations are updated here too.Issue: BB-813
Issue: BB-818