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
Reactivate Google's PickLevelForMemTableOutput() #163
Conversation
…d storage and multiple compaction threads.
…evel-0 then moved to level 2 or 3 will have wrong number of internal reference counts. Riak marks files on 0 and 1 with an extra reference to prevent cache flush.
|
||
if (move_s.ok()) | ||
{ | ||
// builder already added file to table_cache with 2 references and |
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.
The builder added the file to table_cache with mutex_ unlocked; is there any possibility that another thread could have referenced the file via the table_cache before we get to this point?
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.
The new file is not added to the manifest until after this routine returns. The “edit” parameter gets set at line 767 with the new file number and its level. No thread can access this file in the table cache because the file number is not known outside this routine. The “edit” object subsequently gets posted to the manifest. That is when the file number becomes visible.
On Aug 8, 2015, at 4:06 PM, Paul A. Place <notifications@github.com mailto:notifications@github.com> wrote:
In db/db_impl.cc #163 (comment):
std::string old_name, new_name; old_name=TableFileName(options_, meta.number, 0); new_name=TableFileName(options_, meta.number, level);
s=env_->RenameFile(old_name, new_name);
move_s=env_->RenameFile(old_name, new_name);
if (move_s.ok())
{
The builder added the file to table_cache with mutex_ unlocked; is there any possibility that another thread could have referenced the file via the table_cache before we get to this point?// builder already added file to table_cache with 2 references and
—
Reply to this email directly or view it on GitHub https://github.com/basho/leveldb/pull/163/files#r36581285.
Notes to Matthew (github wouldn't let me add these comments inline, since they refer to parts of the code that were not modified):
|
db/db_impl.cc line 1866: updated as suggested db/version_set.cc line 495 corrected: now uses uint64_t instead of int64_t.
|
+1 code review looks good |
Reactivate Google's PickLevelForMemTableOutput()
This routine used to "be in the way" when efforts focused on random data ingest. Now, it has new relevance as Riak's handoff and other sequential features come into play.
Detail discussion is here:
https://github.com/basho/leveldb/wiki/mv-initial-level-fix