Repository navigation
Update Flush policy in PartitionedIndexBuilder on switching from user-key to internal-key mode - #7022
akankshamahajan15 wants to merge 1 commit into
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
ed0d0dc to
27a50f9
Compare
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
27a50f9 to
6924399
Compare
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
1 similar comment
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@akankshamahajan15 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.
This is an allocation per index entry which might be nontrivial. I think the easy way to avoid these extra allocations is to reset the flush policy only when !seperator_is_key_plus_seq_.
There was a problem hiding this comment.
Initially I added the check but then number of partitions got changed (it was changed from 11 to 2). So I couldn't understand why the value got changed by adding additional check !seperator_is_key_plus_seq_.
There was a problem hiding this comment.
I see you added it back. Does it behave as expected now (produce partitions around metadata_block_size bytes) or is there still an unexpectedly small number of partitions?
There was a problem hiding this comment.
Oh my bad. The check at line 132 is fine so i added that but by adding check here (line 170) partitions are still 2 (I forgot to remove this check while uploading the diff). I am still not sure why this is the case. I have added logs to look further for debugging.
There was a problem hiding this comment.
discussed offline, seems it is producing the expected number of partitions now.
6924399 to
46085c7
Compare
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
46085c7 to
f1b72af
Compare
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
ajkr
left a comment
There was a problem hiding this comment.
LGTM! Thanks very much for fixing this!
There was a problem hiding this comment.
discussed offline, seems it is producing the expected number of partitions now.
There was a problem hiding this comment.
For release note it's nice to describe in terms of affected user APIs / options, so people can quickly check whether they're affected (in this case the affected option is index_type == kTwoLevelIndexSearch)
…-key to internal-key mode
Summary: When format_version is high enough to support user-key and there are index entries for same user key that spans multiple data blocks then it changes from user-key mode to internal-key mode. But the flush policy is not reset to point to Block Builder of internal-keys. After this switch, no entries are added to user key index partition result, thus it never triggers flushing the block.
Fix: After adding the entry in sub_builder_index_, if there is a switch from user-key to internal-key, then flush policy is updated to point to Block Builder of internal-keys index partition.
Test Plan: 1. make check -j64
2. Added one unit test case
Reviewers:
Subscribers:
Tasks: T68809728
Tags:
f1b72af to
39d73b1
Compare
|
@akankshamahajan15 has updated the pull request. Re-import the pull request |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@akankshamahajan15 merged this pull request in 5edfe3a. |
Summary: Even though local bisection gave me a clear signal (and still does) that reverting #7049 would fix the failures in MultiThreadedDBTest, #7022 seems to be the root cause. Reverting #7022 and keeping #7049 seems to fix the issue in local reproducer also. (Had these landed in opposite order, bisection would have found the root cause.) Pull Request resolved: #7071 Reviewed By: akankshamahajan15 Differential Revision: D22362857 Pulled By: pdillinger fbshipit-source-id: ed63df3d74e9d4ce1604de8fe43b216166c7a3f0
…-key to internal-key mode (meta#7022) Summary: When format_version is high enough to support user-key and there are index entries for same user key that spans multiple data blocks then it changes from user-key mode to internal-key mode. But the flush policy is not reset to point to Block Builder of internal-keys. After this switch, no entries are added to user key index partition result, thus it never triggers flushing the block. Fix: After adding the entry in sub_builder_index_, if there is a switch from user-key to internal-key, then flush policy is updated to point to Block Builder of internal-keys index partition. Pull Request resolved: meta#7022 Test Plan: 1. make check -j64 2. Added one unit test case Reviewed By: ajkr Differential Revision: D22197734 Pulled By: akankshamahajan15 fbshipit-source-id: d87e9e46bccab8e896ee6979d6b79c51f73d479e
Summary: Even though local bisection gave me a clear signal (and still does) that reverting meta#7049 would fix the failures in MultiThreadedDBTest, meta#7022 seems to be the root cause. Reverting meta#7022 and keeping meta#7049 seems to fix the issue in local reproducer also. (Had these landed in opposite order, bisection would have found the root cause.) Pull Request resolved: meta#7071 Reviewed By: akankshamahajan15 Differential Revision: D22362857 Pulled By: pdillinger fbshipit-source-id: ed63df3d74e9d4ce1604de8fe43b216166c7a3f0
Summary: When format_version is high enough to support user-key and there are index entries for same user key that spans multiple data blocks then it changes from user-key mode to internal-key mode. But the flush policy is not reset to point to Block Builder of internal-keys. After this switch, no entries are added to user key index partition result, thus it never triggers flushing the block.
Fix: After adding the entry in sub_builder_index_, if there is a switch from user-key to internal-key, then flush policy is updated to point to Block Builder of internal-keys index partition.
Test Plan: 1. make check -j64
2. Added one unit test case
Reviewers:
Subscribers:
Tasks: T68809728
Tags: