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

safekeeper: eagerly return AppendResponse with flush_lsn on segment fsync #9688

Open
Tracked by #9624
erikgrinaker opened this issue Nov 8, 2024 · 0 comments · May be fixed by #9692
Open
Tracked by #9624

safekeeper: eagerly return AppendResponse with flush_lsn on segment fsync #9688

erikgrinaker opened this issue Nov 8, 2024 · 0 comments · May be fixed by #9692
Assignees
Labels
a/performance Area: relates to performance of the system c/storage/safekeeper Component: storage: safekeeper

Comments

@erikgrinaker
Copy link
Contributor

When pipelining AppendRequests, the WAL acceptor only returns an AppendResponse with the new flush_lsn when it itself explicitly requests a flush via FlushWAL:

// While receiving AppendRequests, flush the WAL periodically and respond with an
// AppendResponse to let walproposer know we're still alive.
_ = flush_ticker.tick(), if dirty => {
dirty = false;
self.tli
.process_msg(&ProposerAcceptorMessage::FlushWAL)
.await?
}

However, the WAL is also implicitly flushed on segment bounds:

if xlogoff + buf.len() == self.wal_seg_size {
// If we reached the end of a WAL segment, flush and close it.
self.fdatasync_file(&file).await?;

We should eagerly return an AppendResponse in this case, to allow the compute to commit up to that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/performance Area: relates to performance of the system c/storage/safekeeper Component: storage: safekeeper
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant