-
Notifications
You must be signed in to change notification settings - Fork 3.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
[enhancement](cloud) batching get visible version from MetaService #34615
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
4af33e4
to
82fdecc
Compare
clang-tidy review says "All clean, LGTM! 👍" |
2 similar comments
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
278e48b
to
c218ff0
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
@@ -253,16 +257,28 @@ private boolean tablesOrDataChanged(Env env, SqlCacheContext sqlCacheContext) { | |||
return true; | |||
} | |||
OlapTable olapTable = (OlapTable) tableIf; | |||
long currentTableTime = olapTable.getVisibleVersionTime(); | |||
long cacheTableTime = scanTable.latestTimestamp; | |||
//long currentTableTime = olapTable.getVisibleVersionTime(); |
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.
revmove unused code
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.
ok, will do after all these p0 cases passes.
gensrc/proto/cloud.proto
Outdated
@@ -662,6 +663,7 @@ message CommitTxnResponse { | |||
repeated int64 partition_ids = 4; | |||
repeated int64 versions = 5; | |||
repeated TableStatsPB table_stats = 6; | |||
optional int64 version_update_time = 7; |
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.
What is this for? Why is version_update_time related to RecycleTxnPB
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.
They are for batch and single respectively. What makes you think the relation ever existed?
gensrc/proto/cloud.proto
Outdated
@@ -759,6 +761,8 @@ message GetVersionResponse { | |||
repeated int64 table_ids = 4; | |||
repeated int64 partition_ids = 5; | |||
repeated int64 versions = 6; | |||
repeated int64 version_update_times = 7; |
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.
what's the single and multiple update_time for?
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.
ditto
@@ -1043,10 +1043,14 @@ void MetaServiceImpl::commit_txn(::google::protobuf::RpcController* controller, | |||
} | |||
|
|||
// Save versions | |||
int64_t version_update_time = |
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.
add time unit as suffix
e.g. version_update_time_ms
pls. check all the other occurrences
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.
sure, will do
fe/fe-core/src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java
Outdated
Show resolved
Hide resolved
if (Config.isCloudMode()) { | ||
Collection<Long> partitionIds = node.getSelectedPartitionIds(); | ||
List<CloudPartition> partitions = partitionIds.stream() | ||
.sorted() | ||
.map(olapTable::getPartition) | ||
.map(partition -> (CloudPartition) partition) | ||
.collect(Collectors.toList()); | ||
try { | ||
CloudPartition.getSnapshotVisibleVersion(partitions); | ||
} catch (RpcException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} |
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.
add comment to explain it
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
@@ -261,6 +261,7 @@ void MetaServiceImpl::get_version(::google::protobuf::RpcController* controller, | |||
return; | |||
} | |||
response->set_version(version); | |||
// TODO response->set_version_update_time_ms(); |
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.
// TODO response->set_version_update_time_ms(); |
@@ -381,6 +383,7 @@ void MetaServiceImpl::batch_get_version(::google::protobuf::RpcController* contr | |||
break; | |||
} | |||
response->add_versions(version); | |||
// TODO response->add_version_update_times_ms(); |
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.
// TODO response->add_version_update_times_ms(); |
scanTables.add(scanTable); | ||
if (Config.isCloudMode()) { | ||
// get version of related partitions in batch |
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.
How about extracting this operation into OlapTable
, just like OlapTable.selectNonEmptyPartitionIds
?
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.
How about extracting this operation into
OlapTable
, just likeOlapTable.selectNonEmptyPartitionIds
?
The one in NereidssqlCacheManager doesn't use OlapTable but ScanTable, I have no handy idea to unify the two.
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.
Ops! On second thought, I think can give it a try.
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\
TPC-H: Total hot run time: 40655 ms
|
TPC-DS: Total hot run time: 186606 ms
|
ClickBench: Total hot run time: 30.89 s
|
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40406 ms
|
TPC-DS: Total hot run time: 186773 ms
|
ClickBench: Total hot run time: 31.09 s
|
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
TPC-DS: Total hot run time: 171850 ms
|
ClickBench: Total hot run time: 30.46 s
|
Get visible version one by one from MetaService is costly. Batching them into one RPC will not only reduce the work load of RPC service but also reduce the lag. Signed-off-by: freemandealer <[email protected]>
Signed-off-by: freemandealer <[email protected]>
Signed-off-by: freemandealer <[email protected]>
5100bef
to
8a147e6
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39617 ms
|
TPC-DS: Total hot run time: 173967 ms
|
ClickBench: Total hot run time: 30.42 s
|
run p0 |
2 similar comments
run p0 |
run p0 |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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
…34615) Get visible versions one by one from MetaService is costly. Batching them into one RPC will not only reduce the workload of RPC service but also reduce the lag.
This PR fix the in-compatibility introduced by #34615
This PR fix the in-compatibility introduced by #34615
Get visible versions one by one from MetaService is costly. Batching them into one RPC will not only reduce the workload of RPC service but also reduce the lag.