Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-24571 Add methods for saving configuration and leases in the TX storage #5254

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

sashapolo
Copy link
Contributor

https://issues.apache.org/jira/browse/IGNITE-24571

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

/**
* Prefix to store lease information.
*/
private static final byte LEASE_INFO_PREFIX = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static final byte LEASE_INFO_PREFIX = 3;
private static final byte LEASE_INFO_PREFIX = 2;

void updateLastApplied(WriteBatch writeBatch, long index, long term) throws RocksDBException {
columnFamily.put(writeBatch, lastAppliedKey, indexAndTermToBytes(index, term));

lastAppliedIndex = index;

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because these methods are only used during snapshots and write command handling, which are linearized by Raft

@@ -403,8 +382,6 @@ public void destroy() {
try (WriteBatch writeBatch = new WriteBatch()) {
clearStorageData(writeBatch);

writeBatch.delete(lastAppliedIndexAndTermKey);
Copy link
Contributor

@Phillippko Phillippko Feb 21, 2025

Choose a reason for hiding this comment

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

Shouldn't we keep this for older storage versions?

Or we could "migrate" the value in start() method. Read value from the data storage, save to meta storage and delete from data storage

Copy link
Contributor Author

@sashapolo sashapolo Feb 21, 2025

Choose a reason for hiding this comment

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

Shouldn't we keep this for older storage versions?

No, because this key will actually be removed by clearStorageData, this call was always obsolete.

Or we could "migrate" the value in start() method

I think it's just extra code that we will get rid of later anyway

Copy link
Contributor

@Phillippko Phillippko left a comment

Choose a reason for hiding this comment

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

lgtm

@sashapolo sashapolo merged commit 51ec630 into apache:main Feb 21, 2025
1 check passed
@sashapolo sashapolo deleted the ignite-24571 branch February 21, 2025 08:28
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