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

etcd perf: Write pages ASAP (optimistically) #276

Open
ptabor opened this issue May 14, 2021 · 0 comments
Open

etcd perf: Write pages ASAP (optimistically) #276

ptabor opened this issue May 14, 2021 · 0 comments

Comments

@ptabor
Copy link
Contributor

ptabor commented May 14, 2021

Write pages ASAP (optimistically)

It seems to me that bbolt starts 'write' of pages to disk when the transaction is committed:

bbolt/tx.go

Line 537 in 90fdc8d

if _, err := tx.db.ops.writeAt(buf, offset); err != nil {

Taking in consideration that:

  • etcd does not rollbacks the transactions (as these are 'batch' commits)
  • the page is really relevant if it's linked from the 'parents' page (or is a root page).
  • etcd usually keeps appending to a 'last' page rather then doing random edits on set of pages

I think bbolt for etcd should:

  • start writing leaf pages to disk as soon as they are full (even before commit was called).
  • maybe even write `parents' and 'grant parents' of the leaf pages as soon as they modified.
  • successful commit should:
    • write the free-pages index
    • write the 'root' page (and maybe a few (2-3) top level branch pages').
    • maybe 'flush'
  • rolled back commit should return all the written pages back to the free pages list and do NOT modify the root page.

It should make the disk usage way more 'uniform' and commit locks substantially shorter.

Extracted from: etcd-io/etcd#12924

@cenkalti cenkalti self-assigned this May 18, 2023
@github-actions github-actions bot added the stale label Apr 19, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@ahrtr ahrtr reopened this May 10, 2024
@ahrtr ahrtr removed the stale label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants