-
Notifications
You must be signed in to change notification settings - Fork 412
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
Storages: add DMFile & ColumnFileTiny & Segment inverted index reader #10006
base: master
Are you sure you want to change the base?
Storages: add DMFile & ColumnFileTiny & Segment inverted index reader #10006
Conversation
f585ba2
to
9074280
Compare
9074280
to
080d1e3
Compare
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
080d1e3
to
95b3f2e
Compare
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromDMFile.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromDMFile.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
if ( // | ||
PerfContext::file_cache.fg_download_from_s3 > perf_begin.fg_download_from_s3 || // | ||
PerfContext::file_cache.fg_wait_download_from_s3 > perf_begin.fg_wait_download_from_s3) | ||
has_s3_download = true; |
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 statistical method seems a bit odd, and it might lead to inaccuracies due to concurrency. Why not have the downloadFileForLocalRead
function return whether the cache was hit or not?
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromDMFile.cpp
Outdated
Show resolved
Hide resolved
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 rest looks good, very similar to Vector's stream and reader.
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromColumnFileTiny.h
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromColumnFileTiny.h
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromDMFile.h
Outdated
Show resolved
Hide resolved
// If download file failed, retry a few times. | ||
for (auto i = 3; i > 0; --i) | ||
{ | ||
try | ||
{ | ||
if (auto file_guard = file_cache->downloadFileForLocalRead(s3_file_name, index_props.file_size()); | ||
file_guard) | ||
{ | ||
local_index_file_path = file_guard->getLocalFileName(); | ||
break; // Successfully downloaded index into local cache | ||
} | ||
|
||
throw Exception(ErrorCodes::S3_ERROR, "Failed to download vector index file {}", index_file_path); | ||
} | ||
catch (...) | ||
{ | ||
if (i <= 1) | ||
throw; | ||
} | ||
} |
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.
Encapsulate these retry logics within the file cache.
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 will refine this in another PR.
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
dbms/src/Storages/DeltaMerge/Index/InvertedIndex/Reader/ReaderFromColumnFileTiny.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Lloyd-Pottiger <[email protected]>
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.
lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
else | ||
{ | ||
bitmap_filter->append(BitmapFilter(cf->getRows(), true)); | ||
} |
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.
If there are ColumnFileBig with inverted index, now we can not utilize the inverted index in ColumnFileBig?
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.
We will not build index for ColumnFileBig now.
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.
Do we still need to apply a filter afterward?
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 bitmap filter should be the same size of MVCC bitmap.
What problem does this PR solve?
Issue Number: ref #9843
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note