Upgrade microVersionId to timestamp-ordered format and add isReplica#2628
Upgrade microVersionId to timestamp-ordered format and add isReplica#2628maeldonn wants to merge 2 commits into
Conversation
Hello maeldonn,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
|
LGTM |
caf9a51 to
868cae8
Compare
Review by Claude Code |
868cae8 to
2eae0c5
Compare
|
LGTM |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Review by Claude Code |
fbaf3fe to
3160d6b
Compare
|
LGTM — one breaking change to flag: |
3160d6b to
5f4839a
Compare
7be6414 to
2d68077
Compare
| * Get whether this object was written by replication (replica). | ||
| * @return true if this object is a replica | ||
| */ | ||
| getReplicationIsReplica() { |
There was a problem hiding this comment.
i think we should still also have an || data.replicationInfo.status === 'REPLICA' for cross compatiblity with older code ?
There was a problem hiding this comment.
For now it's just a simple getter.
ConflictThere is a conflict between your branch Please resolve the conflict on the feature branch ( git fetch && \
git checkout origin/improvement/ARSN-578/micro-version-id && \
git merge origin/development/8.4Resolve merge conflicts and commit git push origin HEAD:improvement/ARSN-578/micro-version-id |
2d68077 to
031c259
Compare
| storageType: storageType || '', | ||
| dataStoreVersionId: dataStoreVersionId || '', | ||
| isNFS, | ||
| isReplica: isReplica !== undefined ? isReplica : (status === 'REPLICA' ? true : undefined), |
There was a problem hiding this comment.
| isReplica: isReplica !== undefined ? isReplica : (status === 'REPLICA' ? true : undefined), | |
| isReplica: isReplica !== undefined ? isReplica : (status === 'REPLICA' ? true : false), |
not sure if undefined or false when status not REPLICA
There was a problem hiding this comment.
Since it's a boolean i would say false. But if we can save some storage in database, we should use undefined.
110b0c8 to
e166386
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development/8.4 #2628 +/- ##
===================================================
+ Coverage 73.65% 73.71% +0.06%
===================================================
Files 223 223
Lines 18247 18268 +21
Branches 3776 3807 +31
===================================================
+ Hits 13440 13467 +27
+ Misses 4802 4796 -6
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace the random 8-byte hex microVersionId the timestamp-ordered identifier matching the versionId scheme, and add helpers for the crr cascade feature. Add an optional isReplica flag to ReplicationInfo to distinguish replica writes from user writes, enabling cascaded CRR. Issue: ARSN-578
e166386 to
2c429ab
Compare
|
| * - the legacy 16-char random-hex value written by old ObjectMD code | ||
| * - any other string shorter than the minimum valid raw length (27 chars) | ||
| */ | ||
| export function isMicroVersionIdComparable(id: string | null | undefined): boolean { |
There was a problem hiding this comment.
| export function isMicroVersionIdComparable(id: string | null | undefined): boolean { | |
| export function isComparable(id?: string | null): boolean { |
There was a problem hiding this comment.
Can the field really be null ? 🤔
| * 16-char hex, or otherwise too short) : a legacy incoming ID must never | ||
| * produce a false 'stale' or 'loop' event | ||
| */ | ||
| export function checkCrrCascadeEvent( |
There was a problem hiding this comment.
| export function checkCrrCascadeEvent( | |
| export function compare( |
There was a problem hiding this comment.
'loop' | 'stale' | 'proceed' are specific to CRR not to versionID format. We should just expose a simple compare function in this file
|
|
||
| setReplicationStatus(status: string) { | ||
| this._data.replicationInfo.status = status; | ||
| if (status === 'REPLICA') { |
There was a problem hiding this comment.
I think this is useless since we are not going anymore to set status to 'REPLICA'
| * @return true if this object is a replica | ||
| */ | ||
| getReplicationIsReplica(): boolean { | ||
| return this._data.replicationInfo.isReplica === true |
There was a problem hiding this comment.
Not sure if need logic in this getter. Is it used ?
Replace the random 8-byte hex microVersionId with a 20-character timestamp-ordered identifier matching the versionId scheme, and add encode/decode/compare helpers in a new MicroVersionID module. Add an optional isReplica flag to ReplicationInfo to distinguish replica writes from user writes, enabling cascaded CRR.
Issue: ARSN-578
Crr cascaded design : https://github.com/scality/citadel/pull/349
Related PRs :
Cloudserver : scality/cloudserver#6179
CloudserverClient : scality/cloudserverclient#24
Backbeat : scality/backbeat#2747
S3utils : scality/s3utils#395