Skip to content

Conversation

@SylvainSenechal
Copy link
Contributor

WIP
Issue: BB-706

@bert-e
Copy link
Contributor

bert-e commented Oct 6, 2025

Hello sylvainsenechal,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 52.15947% with 288 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.89%. Comparing base (66c19b0) to head (2ad58ce).
⚠️ Report is 30 commits behind head on development/9.1.

Files with missing lines Patch % Lines
extensions/replication/utils/SetupReplication.js 2.46% 79 Missing ⚠️
...xtensions/replication/tasks/MultipleBackendTask.js 37.17% 49 Missing ⚠️
extensions/replication/management.js 3.22% 30 Missing ⚠️
lib/BackbeatMetadataProxy.js 26.82% 30 Missing ⚠️
extensions/lifecycle/management.js 4.34% 22 Missing ⚠️
lib/queuePopulator/IngestionProducer.js 68.57% 22 Missing ⚠️
extensions/replication/tasks/CopyLocationTask.js 56.75% 16 Missing ⚠️
extensions/utils/VaultClientWrapper.js 5.88% 16 Missing ⚠️
lib/credentials/CredentialsManager.js 75.75% 8 Missing ⚠️
lib/clients/utils.js 75.00% 6 Missing ⚠️
... and 4 more

❌ Your patch check has failed because the patch coverage (52.15%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/gc/tasks/GarbageCollectorTask.js 87.28% <100.00%> (+0.10%) ⬆️
...ecycle/bucketProcessor/LifecycleBucketProcessor.js 79.87% <100.00%> (+0.38%) ⬆️
extensions/lifecycle/tasks/LifecycleTaskV2.js 88.88% <ø> (ø)
...ensions/notification/NotificationQueuePopulator.js 98.13% <100.00%> (ø)
...ationStatusProcessor/ReplicationStatusProcessor.js 68.32% <ø> (ø)
lib/clients/ClientManager.js 66.03% <100.00%> (+1.33%) ⬆️
lib/credentials/AccountCredentials.js 64.10% <100.00%> (+0.94%) ⬆️
lib/credentials/RoleCredentials.js 98.00% <100.00%> (+0.32%) ⬆️
lib/queuePopulator/IngestionReader.js 81.60% <ø> (ø)
...sions/lifecycle/tasks/LifecycleDeleteObjectTask.js 92.81% <92.59%> (+0.29%) ⬆️
... and 13 more

... and 9 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.36% <100.00%> (ø)
Core Library 80.34% <59.20%> (-0.68%) ⬇️
Ingestion 70.56% <68.57%> (+0.25%) ⬆️
Lifecycle 78.17% <76.36%> (-0.18%) ⬇️
Oplog Populator 85.06% <ø> (ø)
Replication 57.32% <38.32%> (-3.87%) ⬇️
Bucket Scanner 85.76% <ø> (+0.15%) ⬆️
@@                 Coverage Diff                 @@
##           development/9.1    #2679      +/-   ##
===================================================
- Coverage            74.81%   73.89%   -0.92%     
===================================================
  Files                  201      201              
  Lines                13579    13458     -121     
===================================================
- Hits                 10159     9945     -214     
- Misses                3410     3503      +93     
  Partials                10       10              
Flag Coverage Δ
bucket-scanner 85.76% <ø> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

package.json Outdated
"vaultclient": "scality/vaultclient#8.5.1",
"werelogs": "scality/werelogs#8.2.1"
"werelogs": "scality/werelogs#8.2.1",
"@scality/cloudserverclient": "file:../cloudserverclient"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

conf/config.json Outdated
"replicaSet": "rs0",
"readPreference": "primary",
"database": "metadata"
"replicaSetHosts": "localhost:27017",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

@SylvainSenechal SylvainSenechal force-pushed the improvement/BB-706 branch 5 times, most recently from d06be27 to 11d7667 Compare October 13, 2025 14:47
@scality scality deleted a comment from bert-e Oct 13, 2025
@scality scality deleted a comment from bert-e Oct 13, 2025
@bert-e
Copy link
Contributor

bert-e commented Oct 13, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@SylvainSenechal SylvainSenechal force-pushed the improvement/BB-706 branch 2 times, most recently from 130fc22 to 5c4933f Compare October 14, 2025 09:51
const { attachReqUids } = require('../../../lib/clients/utils');

const BackbeatTask = require('../../../lib/tasks/BackbeatTask');
const { BatchDeleteCommand } = require('../../../lib/clients/smithy/build/smithy/source/typescript-codegen');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not pay attention to these imports path. They will be updated once the new library is released

return done(err);
}

const backbeatClient = this.getBackbeatClient(accountId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note : There are a lot of variables, function names and possibly file names that would benefit from a rename, from backbeatClient to cloudserverClient etc.
I don't wanna do it now because it will add a lot of noise to that PR, and it's not even that straightforward to do with this silly programming language

Key: destEntry.getObjectKey(),
CanonicalID: destEntry.getOwnerId(),
// TODO : missing content length
ContentLength: partSize,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed content-length. Smithy doesn't allow us to have a content length variable that we defined ourselves to be used as the header, because it's calculating the header itself.
Only thing I'm worried about is that the new ContentLength from Smithy might not be equal to the previous one : I think the new ones uses the whole request, when our old content length was partObj.getObjSize()

@SylvainSenechal SylvainSenechal force-pushed the improvement/BB-706 branch 3 times, most recently from 404c946 to 897ee3e Compare October 14, 2025 14:06
// eslint-disable-next-line no-param-reassign
err.origin = 'target';
if (err.ObjNotFound || err.code === 'ObjNotFound') {
if (err.ObjNotFound || err.code === 'ObjNotFound' ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't super nice error checking 🫤

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot guaarantee the type of error there? is it always an arsenal error, or an sdk one? if sdk you should be able to use instanceof, no?
Side note: can't it also be a NoSuchVersion in this case, if the versionID is not empty?

Copy link
Contributor Author

@SylvainSenechal SylvainSenechal Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked, we can use err.name === 'ObjNotFound' (or err.code too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the side note, I wasnt able to trigger any NoSuchVersion, but I was able to trigger NoSuchBucket.
In any case, nto very important imo : the error will always be thrown, this if statement is only there to not log the error in this specific situation

.then(data => {
sourceEntry.setReplicationSiteDataStoreVersionId(this.site,
data.versionId);
// TODO : review metadata metrics
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@francoisferrand I think using JSON.stringify will work, I see that the function .getSerialized() in Arsenal also returns a string from JSON.stringify that is then used in this same _publishMetadataWriteMetrics, but I'm not sure that "command.input" is equivalent to the old "destReq.httpRequest.body" data we used to call it with

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few occurences where this _publishMetadataWriteMetrics is an issue for me.
Actually, we can add a middleware to extract the request body like this, and pass it to the metrics just as before.
Although, I have found that here it would likely be useless, because as you can see in the command above, there is Body in the command, so the length would always be 0.
I have only found one occurence where we the request has a body

command.middlewareStack.add(
        next => async args => {
            const request = args.request as any;
            console.log("content-length:", request?.headers?.['content-length'])
            console.log("len", Buffer.byteLength(request.body as any))
            return next(args);
        },
        { step: 'finalizeRequest' }
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thought : With the old SDK, we were using destReq.httpRequest.body, but if you look at the command, there is no proper body parameter, and with the new v3 client, I tried to get the body with the middleware and it is undefined...
Anyways, probably not worth it to overthink this problem, we just need to clearly state what is the metric we want to compute first (I believe that here it's the Tags, since the api is putTagging), so we probably just want to do something like
this._publishMetadataWriteMetrics(JSON.stringify(command.input.Tags), writeStartTime)

if (err) {
return this._ringReader.send(command)
.then(data => {
// TODO : Review : data[0] doesn't make sense, considering the output shape.. :
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need input from other ppl who know this stuff.
Considering the output of getRaftId is a string,
Either,

  • We indeed want to read the first character of that string
  • Or we expect it to be an array and want to read the first element, but in that case there is a problem with api definition

Either way, weird api design

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output looks like this, but can RaftID be multiple digit ?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes each raft session has an id, so if you have 10 then it'll be 2 digits

For instance in Scuba we type it like htis: https://github.com/scality/scuba/blob/d6c285163fb7fa2113aecc32f14623bda60e7508/lib/utils/logId.ts#L6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh, so if raftId == '13', sounds like the old code getting the raftId from data[0] would be getting '1' instead of '13' 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe @scality/hopocalypse team can help better understand this, i.e. how the API behaves and maybe why we used to take only the first character of the string?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

], done);
}

// TODO : review streaming logic..
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO : review

@bert-e
Copy link
Contributor

bert-e commented Nov 6, 2025

Incorrect fix version

The Fix Version/s in issue BB-706 contains:

  • 9.2.0

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.1.2

Please check the Fix Version/s of BB-706, or the target
branch of this pull request.

@SylvainSenechal SylvainSenechal force-pushed the improvement/BB-706 branch 11 times, most recently from 5eef1b8 to 6121867 Compare November 6, 2025 20:30
@SylvainSenechal SylvainSenechal force-pushed the improvement/BB-706 branch 11 times, most recently from e9bb058 to 1900121 Compare November 7, 2025 14:32
@bert-e
Copy link
Contributor

bert-e commented Nov 11, 2025

Incorrect fix version

The Fix Version/s in issue BB-706 contains:

  • 9.2.0

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.1.3

Please check the Fix Version/s of BB-706, or the target
branch of this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants