Skip to content

bf: CLDSRV-647 crash in getReplicationInfo with no replication endpoint#5796

Merged
bert-e merged 3 commits into
development/7.10from
bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
May 14, 2025
Merged

bf: CLDSRV-647 crash in getReplicationInfo with no replication endpoint#5796
bert-e merged 3 commits into
development/7.10from
bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

Conversation

@jonathan-gramain
Copy link
Copy Markdown
Contributor

  • Fix an exception in getReplicationInfo when:

    • no StorageClass is provided
    • no replication endpoint is configured

    Instead, return undefined so the object is not set to PENDING state for replication, even if the bucket already has a replication configuration enabled.

  • [refactor] pass S3 config to getReplicationInfo

    Instead of pulling the location constraints and replication endpoints from the Cloudserver config within the getReplicationInfo helper itself, pass the config object explicitly. This makes the function pure, using only its input parameters, hence more test cases can be easily added with a different configuration for location constraints and/or replication endpoints.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Hello jonathan-gramain,

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 9, 2025

Incorrect fix version

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

  • 7.10.55

  • 7.70.66

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

  • 7.10.55

  • 7.70.66

  • 8.8.47

  • 9.0.10

  • 9.1.0

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

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
 $ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 10, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/8.8.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/8.8
 $ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@jonathan-gramain jonathan-gramain force-pushed the bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint branch from 6edbf9c to e0f23a1 Compare May 12, 2025 17:22
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

History mismatch

Merge commit #787728a3df11bc5b55b4baea57812ac3b2bc4117 on the integration branch
w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint is merging a branch which is neither the current
branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint nor the development branch
development/7.70.

It is likely due to a rebase of the branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: create_integration_branches

@jonathan-gramain jonathan-gramain force-pushed the bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint branch from e0f23a1 to 7cbc72b Compare May 13, 2025 16:20
@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/reset

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Reset complete

I have successfully deleted this pull request's integration branches.

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
 $ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/8.8.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/8.8
 $ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Conflict

A conflict has been raised during the update of
integration branch w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/8.8.

Please resolve the conflict on the integration branch (w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint).

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ git pull  # or "git reset --hard origin/w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint"
 $ git merge origin/development/8.8
 $ # <intense conflict resolution>
 $ git commit
 $ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/9.0/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/9.0.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/9.0/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/9.0
 $ git merge origin/w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/9.0/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/7.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 13, 2025

Waiting for approval

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

  • the author

  • 2 peers

The following options are set: create_integration_branches

Copy link
Copy Markdown
Contributor

@anurag4DSB anurag4DSB left a comment

Choose a reason for hiding this comment

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

At some places we are using config and others s3config, worth having that consistent or is it intentional?

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

@anurag4DSB

At some places we are using config and others s3config, worth having that consistent or is it intentional?

In the caller's context, it's usually named config because it's how it's imported globally and doesn't cause an ambiguity at this level

In the callee's context (getReplicationInfo), it may be ambiguous as there's the replication config as well, and since it's a helper I though it best to emphasize that the config is (or has the same format than) the global S3 config.

@jonathan-gramain jonathan-gramain requested a review from Copilot May 14, 2025 20:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a crash in getReplicationInfo by returning undefined when no StorageClass is provided or when no replication endpoint is configured, and it refactors the function to become pure by passing the S3 configuration explicitly.

  • Refactors getReplicationInfo and internal helper functions to accept a config parameter.
  • Updates multiple API endpoints and tests to ensure consistent usage of the new function signature.
  • Bumps the package version from 7.10.54 to 7.10.55.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/api/apiUtils/getReplicationInfo.js Updated tests to pass TEST_CONFIG explicitly to _getObjectReplicationInfo.
package.json Version bump to reflect the update.
lib/metadata/acl.js Updated getReplicationInfo call to include config.
lib/api/objectPutTagging.js Updated getReplicationInfo call to include config.
lib/api/objectPutRetention.js Updated getReplicationInfo call to include config.
lib/api/objectPutLegalHold.js Updated getReplicationInfo call to include config.
lib/api/objectDeleteTagging.js Updated getReplicationInfo call to include config.
lib/api/objectCopy.js Updated getReplicationInfo call to include config.
lib/api/completeMultipartUpload.js Updated getReplicationInfo call to include config.
lib/api/apiUtils/object/getReplicationInfo.js Refactored internal functions and updated signature to accept s3config.
lib/api/apiUtils/object/createAndStoreObject.js Updated getReplicationInfo call to include config.

Instead of pulling the location constraints and replication endpoints
from the Cloudserver config within the getReplicationInfo helper
itself, pass the config object explicitly. This makes the function
pure, using only its input parameters, hence more test cases can be
easily added with a different configuration for location constraints
and/or replication endpoints.
Fix an exception in getReplicationInfo when:

- no StorageClass is provided
- no replication endpoint is configured

Instead, return `undefined` so the object is not set to PENDING state
for replication, even if the bucket already has a replication
configuration enabled.
@jonathan-gramain jonathan-gramain force-pushed the bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint branch from b6a6d54 to 71bbee6 Compare May 14, 2025 20:55
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

History mismatch

Merge commit #164b61488049a6eaf8e53a8cd1416b2272e5bf1f on the integration branch
w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint is merging a branch which is neither the current
branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint nor the development branch
development/7.70.

It is likely due to a rebase of the branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: create_integration_branches

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/reset

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

Reset complete

I have successfully deleted this pull request's integration branches.

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint with contents from bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
 $ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

History mismatch

Merge commit #a698c2f0f51788fd4232bc40cb62d20b8102df3e on the integration branch
w/9.1/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint is merging a branch which is neither the current
branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint nor the development branch
development/9.1.

It is likely due to a rebase of the branch bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/7.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

Waiting for approval

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

  • the author

  • 2 peers

The following options are set: create_integration_branches

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 14, 2025

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.8

  • ✔️ development/9.0

  • ✔️ development/9.1

The following branches have NOT changed:

  • development/7.4

Please check the status of the associated issue CLDSRV-647.

Goodbye jonathan-gramain.

The following options are set: approve, create_integration_branches

@bert-e bert-e merged commit 71bbee6 into development/7.10 May 14, 2025
10 checks passed
@bert-e bert-e deleted the bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint branch May 14, 2025 22:04
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.

5 participants