Skip to content

Conversation

@feeblefakie
Copy link
Contributor

This is an automated request for a manual backport of the following:

  1. Resolve any conflicts that occur during the cherry-picking process.
git fetch origin &&
git checkout 3.16-pull-3113 &&
git cherry-pick --no-rerere-autoupdate -m1 477fba5caa8cf594a5c77c8268903342639726d3
  1. Push the changes.
  2. Merge this PR after all checks have passed.

Thank you!

@brfrn169 brfrn169 marked this pull request as ready for review November 8, 2025 16:15
@brfrn169 brfrn169 requested a review from Copilot November 8, 2025 16:16
@brfrn169
Copy link
Collaborator

brfrn169 commented Nov 8, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively unifies the logic for preparing Get and Scan operations for storage access by centralizing it in ConsensusCommitUtils. This refactoring significantly improves code maintainability by removing duplicated logic from CrudHandler and Snapshot. The changes are well-structured, and the related classes and tests have been updated accordingly. I have one suggestion to improve the implementation of a new helper method to prevent potential stack overflow issues.

Copy link
Contributor

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 pull request refactors the consensus commit transaction handling by extracting conjunction conversion logic from CrudHandler into ConsensusCommitUtils. The key changes include:

  • Extracted prepareGetForStorage() and prepareScanForStorage() utility methods to centralize preparation of Get/Scan operations for storage
  • Updated Snapshot validation logic to use the new utility methods and filter results based on conjunctions
  • Refactored CrudHandler to use the extracted utilities and simplified resource management
  • Migrated tests from deprecated API constructors to builder pattern
  • Added comprehensive test coverage for the new utility methods

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ConsensusCommitSpecificIntegrationTestBase.java Fixed bug: changed manager.get() to transaction.get() for correct transaction context
SnapshotTest.java Migrated from deprecated constructors to builder pattern and removed unnecessary consistency settings
CrudHandlerTest.java Updated tests to match refactored API, removed duplicate tests now covered in ConsensusCommitUtilsTest
ConsensusCommitUtilsTest.java Added comprehensive tests for new prepareGetForStorage() and prepareScanForStorage() methods
Snapshot.java Added conjunction filtering logic and delegated storage preparation to ConsensusCommitUtils
CrudHandler.java Refactored to use ConsensusCommitUtils methods and simplified resource management with try-with-resources
ConsensusCommitUtils.java Added new utility methods for preparing Get/Scan operations with conjunction conversion logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brfrn169 brfrn169 merged commit 9d6dc1f into 3.16 Nov 9, 2025
214 of 218 checks passed
@brfrn169 brfrn169 deleted the 3.16-pull-3113 branch November 9, 2025 05:13
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.

2 participants