Add Crr Cascade capabilities to backbeat crr replication#2747
Add Crr Cascade capabilities to backbeat crr replication#2747SylvainSenechal wants to merge 1 commit into
Conversation
Hello sylvainsenechal,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
|
There was a problem hiding this comment.
I think we can functional tests instead of just these,
But waiting for Arsenal/cloudserver to be merged, as it will be easier to make these tests (functional tests in backbeat rely on an image of cloudserver)
There was a problem hiding this comment.
keeping unit test is good, functional test should just be an addition?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 3 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.5 #2747 +/- ##
===================================================
- Coverage 75.23% 75.05% -0.18%
===================================================
Files 200 200
Lines 13764 13815 +51
===================================================
+ Hits 10355 10369 +14
- Misses 3399 3436 +37
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
|
4c64ed6 to
3237f9e
Compare
| "@smithy/node-http-handler": "^3.3.3", | ||
| "JSONStream": "^1.3.5", | ||
| "arsenal": "git+https://github.com/scality/arsenal#8.3.9", | ||
| "arsenal": "git+https://github.com/scality/Arsenal#2c429ab35a5ac82c3dafa5a0296a49a23a9c8a4a", |
There was a problem hiding this comment.
Arsenal is pinned to a raw commit hash (2c429ab...) instead of a semantic version tag. Per project conventions, git-based deps (arsenal, vaultclient, etc.) should pin to tags (e.g. #8.x.y). Commit hashes are opaque — it's unclear which features/fixes are included, and there's no semver contract. This also makes it harder for reviewers and operators to reason about what changed.
— Claude Code
|
8f58576 to
ff132db
Compare
|
ff132db to
d76afbc
Compare
|
PR Review Summary — Add CRR Cascade capabilities |
d76afbc to
f9df514
Compare
f9df514 to
ab2ea02
Compare
ab2ea02 to
13dafae
Compare
13dafae to
7dae570
Compare
7dae570 to
5780ef4
Compare
| VersioningRequired: true, | ||
| RequestUids: log.getSerializedUids(), | ||
| }); | ||
| const putCommand = attachExpectContinueMiddleware( |
There was a problem hiding this comment.
Can you create the follow-up ticket @SylvainSenechal ?
| err, sourceEntry, destEntry, kafkaEntry, log, done)); | ||
| } | ||
|
|
||
| _handleReplicationOutcome(err, sourceEntry, destEntry, kafkaEntry, |
There was a problem hiding this comment.
This section has quite a bit of nested conditional logic and duplicate checks that make it hard to read and maintain.
Could we flatten this using guard clauses (early returns) and abstract the err.XYZ || err.name === 'XYZ' checks into a helper function? It would drastically reduce the cognitive load of this function. Let me know if you want to pair on it!
There was a problem hiding this comment.
I agree its trash code and the diff is hard to read with the last else
I just changed it and tried something that i didn't want to do first but i think it's fine : for each condition, directly publish/return, without having to do it at the end of the function. I believe its quite readable this way
There was a problem hiding this comment.
Could still use some refactor maybe, although all the erro don't have the same form, I think the diff is reasonnable here
| this._getAndPutPart(sourceEntry, destEntry, part, log, done); | ||
| }, (err, destLocations) => { | ||
| }, (err, partResults) => { | ||
| const destLocations = (partResults || []) |
There was a problem hiding this comment.
Could you extract this change into its own commit so you can explain the 'why' in the commit description ?
There was a problem hiding this comment.
For now I added some comments to clarify this a bit
| }); | ||
| } | ||
|
|
||
| _resolveVersionIdCollision(collisionErr, sourceEntry, destEntry, log) { |
There was a problem hiding this comment.
The logical flow here using early returns is great, but the function feels a bit hard to read due to the repetitive log metadata block being copied into every if statement.
We can dramatically clean this up by extracting method and destEntry.getLogInfo() into a single const logMeta object at the top of the function, then passing it directly to log.info/log.error. What do you think?
There was a problem hiding this comment.
true the whole function is just logs
42ef0e4 to
fd87ff8
Compare
fd87ff8 to
d1bf122
Compare
Issue: BB-767
Related PRs :
Arsenal : scality/Arsenal#2628
Cloudserver : scality/cloudserver#6179
CloudserverClient : scality/cloudserverclient#24
S3utils : scality/s3utils#395