Skip to content

CLDSRV-899: Log replication events in server access logs#6164

Open
dvasilas wants to merge 7 commits into
development/9.2from
improvement/CLDSRV-899-log-replication-events
Open

CLDSRV-899: Log replication events in server access logs#6164
dvasilas wants to merge 7 commits into
development/9.2from
improvement/CLDSRV-899-log-replication-events

Conversation

@dvasilas
Copy link
Copy Markdown
Contributor

@dvasilas dvasilas commented May 4, 2026

Replication writes via the backbeat putData route are now visible in the destination bucket's server access logs.

Reads from the source bucket are already logged as REST.GET.OBJECT.

Study of AWS server access logging with replication: https://scality.atlassian.net/browse/S3C-11048?focusedCommentId=473763

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 4, 2026

Hello dvasilas,

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.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 4, 2026

Incorrect fix version

The Fix Version/s in issue CLDSRV-899 contains:

  • None

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

  • 9.2.40

  • 9.3.7

  • 9.4.0

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

@claude
Copy link
Copy Markdown

claude Bot commented May 4, 2026

LGTM

Clean, well-scoped change. The replication flag flows correctly from putData through getOperation and logServerAccess. The loggingEnabled guard correctly allows replication entries through alongside expiration. The synthesized requestURI matches the pattern used by getURI(). Tests cover the key scenarios including error paths. No issues found.

Review by Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (22f67e0) to head (67a6c3d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/routes/routeBackbeat.js 41.66% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/utilities/serverAccessLogger.js 84.87% <100.00%> (+1.47%) ⬆️
lib/routes/routeBackbeat.js 76.17% <41.66%> (-0.57%) ⬇️

... and 1 file with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.2    #6164      +/-   ##
===================================================
- Coverage            84.50%   84.46%   -0.05%     
===================================================
  Files                  204      204              
  Lines                13180    13216      +36     
===================================================
+ Hits                 11138    11163      +25     
- Misses                2042     2053      +11     
Flag Coverage Δ
file-ft-tests 67.98% <13.88%> (-0.15%) ⬇️
kmip-ft-tests 28.42% <2.77%> (-0.08%) ⬇️
mongo-v0-ft-tests 69.25% <13.88%> (-0.12%) ⬇️
mongo-v1-ft-tests 69.26% <13.88%> (-0.16%) ⬇️
multiple-backend 35.69% <58.33%> (+0.06%) ⬆️
sur-tests 36.80% <2.77%> (-0.13%) ⬇️
sur-tests-inflights 37.81% <2.77%> (-0.10%) ⬇️
unit 70.30% <77.77%> (+0.02%) ⬆️
utapi-v2-tests 34.70% <2.77%> (-0.09%) ⬇️

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from b922c2f to 803285c Compare May 7, 2026 11:16
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 7, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

LGTM

Review by Claude Code

1 similar comment
@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

LGTM

Review by Claude Code

@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from 0c52210 to 812257c Compare May 8, 2026 10:51
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 8, 2026

Incorrect fix version

The Fix Version/s in issue CLDSRV-899 contains:

  • 9.2.40

  • 9.3.7

  • 9.4.0

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

  • 9.2.40

  • 9.3.8

  • 9.4.0

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

Comment thread lib/routes/routeBackbeat.js Outdated
Comment thread lib/utilities/serverAccessLogger.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

  • Typo in comment: "distinquish" → "distinguish" (routeBackbeat.js:540)
    • One-click suggestion provided
  • Synthesized requestURI for replication uses URI-decoded objectKey, while normal S3 entries use raw HTTP-encoded URL — could cause inconsistent log parsing for keys with special characters (serverAccessLogger.js:660)
    • Consider re-encoding the key to match non-replication entries

Review by Claude Code

@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from 812257c to 2c9ff6d Compare May 8, 2026 18:49
Comment thread lib/routes/routeBackbeat.js Outdated
Comment thread lib/utilities/serverAccessLogger.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

  • Typo in routeBackbeat.js:540 — "distinquish" should be "distinguish".
    - Suggestion applied inline.
    - Synthesized requestURI for replication logs uses decoded objectKey/bucketName, while normal requests use the raw URL-encoded request.url via getURI(). Object keys with special characters (spaces, unicode) will look different in replication vs. normal log entries.
    - Consider wrapping the bucket and key with encodeURIComponent (or S3-style encoding) to match the non-replication format.

    Review by Claude Code

@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from 2c9ff6d to 7c20606 Compare May 11, 2026 07:49
@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

LGTM

Clean implementation. The replication-type detection in putMetadata correctly uses replicationInfo.status === 'REPLICA' to distinguish destination-side events. The loggingEnabled gate change is correct, and the URI synthesis with encodeURIComponent on the decoded objectKey produces proper S3-style log entries. Tests cover all four replication variants plus the error case.

Review by Claude Code

dvasilas added 4 commits May 11, 2026 11:46
Replication writes via the backbeat putData route are now visible in
bucket server access logs with operation = REST.PUT.OBJECT.
Destination-side delete-marker replication is now logged as
REST.DELETE.OBJECT, same as AWS.
Destination-side PutObjectTagging and DeleteObjectTagging
replication are now logged as REST.PUT.OBJECT_TAGGING (same as AWS).

AWS replicates a DeleteObjectTagging on the destination as
REST.PUT.OBJECT_TAGGING with an empty tag set URI:
PUT /<bucket>/<key>?tagging&versionId=<vid>.
Destination-side PutObjectAcl replication is now logged as
REST.PUT.ACL.

AWS replicates a PutObjectAcl on the destination as REST.PUT.ACL
with URI PUT /<bucket>/<key>?acl&versionId=<srcVersionId>
and aclRequired = 'Yes'.
@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from 7c20606 to d40302d Compare May 11, 2026 08:46
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 11, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

LGTM

Review by Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

LGTM

Clean implementation with good test coverage. The replication sub-type detection in putMetadata correctly gates on REPLICA status to avoid false-flagging source-side updates. The URI synthesis in logServerAccess properly encodes object key segments and handles all four replication shapes (data, delete-marker, tagging, ACL). The loggingEnabled condition change correctly unblocks replication entries for log courier delivery while keeping other backbeat operations suppressed.

Review by Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

LGTM

Review by Claude Code

@dvasilas dvasilas force-pushed the improvement/CLDSRV-899-log-replication-events branch from fcf7e61 to 67a6c3d Compare May 11, 2026 10:08
@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

LGTM

Review by Claude Code

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.

3 participants