-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
update IterKey that can get user key and internal key explicitly #2084
Conversation
@lightmark updated the pull request - view changes |
@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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.
can you arc lint? a lot of the lines are >80 chars
@lightmark updated the pull request - view changes - changes since last import |
@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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.
thanks for making it clearer which type of key we're using. probably could be even stricter if we don't use the same variable to store both user and internal keys (maybe next tech debt week :)).
@@ -991,7 +999,7 @@ void DBIter::Seek(const Slice& target) { | |||
|
|||
{ | |||
PERF_TIMER_GUARD(seek_internal_seek_time); | |||
iter_->Seek(saved_key_.GetKey()); | |||
iter_->Seek(saved_key_.GetInternalKey()); |
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.
nooooo :(, any way to make saved_key_ consistently use internal or user? (in a separate diff)
db/dbformat.h
Outdated
@@ -347,29 +358,25 @@ class IterKey { | |||
memcpy(buf_ + shared_len, non_shared_data, non_shared_len); | |||
key_ = buf_; | |||
key_size_ = total_size; | |||
is_user_key_ = is_user_key; |
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.
i didn't understand why TrimAppend() should be able to change the key's type
table/plain_table_key_coding.cc
Outdated
} else { | ||
cur_key_.Reserve(prefix_len_ + size); | ||
cur_key_.SetInternalKey(Slice(saved_user_key_.data(), prefix_len_), | ||
*parsed_key); | ||
} | ||
parsed_key->user_key = ExtractUserKey(cur_key_.GetKey()); | ||
parsed_key->user_key = ExtractUserKey(cur_key_.GetInternalKey()); |
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.
just call getuserkey()
@lightmark updated the pull request - view changes - changes since last import |
@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
to void future bug that caused by the mix of userkey/internalkey