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

chore(enhancement): rename is_txn_mode to txn_context_enabled #2644

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Nov 4, 2024

is_txn_mode is used both in storage and Context, so renaming the argument

WriteBatchIndexer handle(ctx);
auto s = updates->Iterate(&handle);
if (!s.ok()) return s;
ctx.batch = nullptr;
Copy link
Member

@PragmaTwice PragmaTwice Nov 4, 2024

Choose a reason for hiding this comment

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

Why do we need to clear ctx.batch if it's not null?

Copy link
Member Author

Choose a reason for hiding this comment

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

comment aboved

Copy link
Member

Choose a reason for hiding this comment

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

Got it.

And why do we now avoid to create a new write batch if ctx.batch is null?

Copy link
Member

Choose a reason for hiding this comment

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

Ahh I think no actually write happens so we can omit it.

@PragmaTwice PragmaTwice changed the title chore(enhancement): change is_txn_mode to txn_context_enabled chore(enhancement): rename is_txn_mode to txn_context_enabled Nov 4, 2024
PragmaTwice
PragmaTwice previously approved these changes Nov 4, 2024
@mapleFU
Copy link
Member Author

mapleFU commented Nov 5, 2024

A bug exists in this refactor, will dive into it tomorrow

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