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

fix(replication): Fix journal record flush #3075

Closed
wants to merge 1 commit into from

Conversation

dranikpg
Copy link
Contributor

Fixes a bug with buffer not being flushed

@dranikpg dranikpg changed the title fix(replication): Fix journal records fix(replication): Fix journal record flush May 24, 2024
Signed-off-by: Vladislav Oleshko <[email protected]>
@@ -34,6 +34,7 @@ class Journal {

LSN GetLsn() const;

// WHY NO COMMENTS?? :(
Copy link
Contributor Author

@dranikpg dranikpg May 24, 2024

Choose a reason for hiding this comment

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

specifically why this flag was introduced, and whether it's safe to suspend in the general case from custom journal handlers

@romange romange requested a review from adiholden May 24, 2024 14:32
@@ -18,8 +18,7 @@ using Payload = journal::Entry::Payload;
void RecordJournal(const OpArgs& op_args, string_view cmd, ArgSlice args, uint32_t shard_cnt,
bool multi_commands) {
VLOG(2) << "Logging command " << cmd << " from txn " << op_args.tx->txid();
op_args.tx->LogJournalOnShard(op_args.shard, Payload(cmd, args), shard_cnt, multi_commands,
false);
op_args.tx->LogJournalOnShard(op_args.shard, Payload(cmd, args), shard_cnt, multi_commands, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The call to RecordJournal is always from non auto journal commands where we call RecordJournal inside the command callback. Untill now we did not allow preemption in callbacks, we have some assumptions in code that callbacks do not preempt. We do need to fix them as part of the effort of Big values serialization Shahar is working on

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with @dranikpg that a comment is missing that explains why we need to avoid preemption.
Also, I am SURE it is possible to fix the logic so that we won't aggregate gigabytes of memory even if we do not allow preemption in the callback.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes I agree. I remember that this fix - https://github.com/dragonflydb/dragonfly/pull/3016/files should fix the problem. I will check the issue again

@dranikpg
Copy link
Contributor Author

Closed for #3084

@dranikpg dranikpg closed this May 26, 2024
@dranikpg dranikpg deleted the fix-mset-journal branch May 27, 2024 07:45
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