-
Notifications
You must be signed in to change notification settings - Fork 491
db: manually managed memTable arena memory #527
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
Conversation
2cd7183
to
fdc5abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready for a look.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @itsbilal and @sumeerbhola)
open.go, line 64 at r1 (raw file):
// allocated memory resources. Note that rather than look for an error, we // look for the return of a nil DB pointer. if r := recover(); db == nil {
This was probably the trickiest part of the change: properly performing cleanup during the various error conditions that can occur during Open
. Something similar showed up in #529.
1643a3e
to
aecc9c4
Compare
The first commit is #529 which is needed for all of the test changes to properly close DBs. |
6ad5a30
to
a0d9a1c
Compare
This has been rebased now that #529 has been merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 32 of 41 files at r2, 6 of 6 files at r3.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @itsbilal and @petermattis)
mem_table.go, line 42 at r3 (raw file):
// A memTable is implemented on top of a lock-free arena-backed skiplist. An // arena is a fixed size contiguous chunk of memory (see // Options.MemTableSize). A memTable's memory consumtion is thus fixed at
nit: consumption
mem_table.go, line 49 at r3 (raw file):
// A batch is "applied" to a memTable in a two step process: prepare(batch) -> // apply(batch). memTable.prepare() is not thread-safe and must be called with // external sychronization. Preparation reserves space in the memTable for the
nit: synchronization
internal/arenaskl/arena.go, line 43 at r3 (raw file):
) // NewArena allocates a new arena of the specified size and returns it.
comment is stale
a0d9a1c
to
8a09a3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @itsbilal and @sumeerbhola)
mem_table.go, line 42 at r3 (raw file):
Previously, sumeerbhola wrote…
nit: consumption
Done. Apparently, I need to use spellcheck on my comments.
internal/arenaskl/arena.go, line 43 at r3 (raw file):
Previously, sumeerbhola wrote…
comment is stale
Done.
8a09a3a
to
9f89954
Compare
TFTR! |
9f89954
to
317978e
Compare
317978e
to
99983b9
Compare
I had to add a few test-only fixes to missed |
No description provided.