You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2023/06/29 09:19:08 UTC
[doris] branch master updated: [fix](restore) work around, ingest binlog after backup/restore which local_tablet.partition_id is not correct, use req.partition_id (#21288)
This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 8c532e8808 [fix](restore) work around, ingest binlog after backup/restore which local_tablet.partition_id is not correct, use req.partition_id (#21288)
8c532e8808 is described below
commit 8c532e8808125cbd2e144b30f689c07151635b19
Author: Jack Drogon <ja...@gmail.com>
AuthorDate: Thu Jun 29 17:19:02 2023 +0800
[fix](restore) work around, ingest binlog after backup/restore which local_tablet.partition_id is not correct, use req.partition_id (#21288)
* work around, ingest binlog after backup/restore which local_tablet.partition_id is not correct, use by
req.partition_id
Signed-off-by: Jack Drogon <ja...@gmail.com>
---
be/src/service/backend_service.cpp | 11 ++++++-----
.../groovy/org/apache/doris/regression/suite/Syncer.groovy | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp
index 1b4a1ec944..76722ba858 100644
--- a/be/src/service/backend_service.cpp
+++ b/be/src/service/backend_service.cpp
@@ -384,6 +384,7 @@ void BackendService::check_storage_format(TCheckStorageFormatResult& result) {
void BackendService::ingest_binlog(TIngestBinlogResult& result,
const TIngestBinlogRequest& request) {
+ constexpr uint64_t kMaxTimeoutMs = 1000;
TStatus tstatus;
Defer defer {[&result, &tstatus]() { result.__set_status(tstatus); }};
@@ -485,7 +486,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result,
std::string binlog_info;
auto get_binlog_info_cb = [&get_binlog_info_url, &binlog_info](HttpClient* client) {
RETURN_IF_ERROR(client->init(get_binlog_info_url));
- client->set_timeout_ms(10); // 10ms
+ client->set_timeout_ms(kMaxTimeoutMs);
return client->execute(&binlog_info);
};
status = HttpClient::execute_with_retry(max_retry, 1, get_binlog_info_cb);
@@ -509,7 +510,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result,
std::string rowset_meta_str;
auto get_rowset_meta_cb = [&get_rowset_meta_url, &rowset_meta_str](HttpClient* client) {
RETURN_IF_ERROR(client->init(get_rowset_meta_url));
- client->set_timeout_ms(10); // 10ms
+ client->set_timeout_ms(kMaxTimeoutMs);
return client->execute(&rowset_meta_str);
};
status = HttpClient::execute_with_retry(max_retry, 1, get_rowset_meta_cb);
@@ -528,7 +529,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result,
}
// rewrite rowset meta
rowset_meta_pb.set_tablet_id(local_tablet_id);
- rowset_meta_pb.set_partition_id(local_tablet->tablet_meta()->partition_id());
+ rowset_meta_pb.set_partition_id(partition_id);
rowset_meta_pb.set_tablet_schema_hash(local_tablet->tablet_meta()->schema_hash());
rowset_meta_pb.set_txn_id(txn_id);
rowset_meta_pb.set_rowset_state(RowsetStatePB::COMMITTED);
@@ -556,7 +557,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result,
auto get_segment_file_size_cb = [&get_segment_file_size_url,
&segment_file_size](HttpClient* client) {
RETURN_IF_ERROR(client->init(get_segment_file_size_url));
- client->set_timeout_ms(10); // 10ms
+ client->set_timeout_ms(kMaxTimeoutMs);
RETURN_IF_ERROR(client->head());
return client->get_content_length(&segment_file_size);
};
@@ -600,7 +601,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result,
auto get_segment_file_cb = [&get_segment_file_url, &local_segment_path, segment_file_size,
estimate_timeout](HttpClient* client) {
RETURN_IF_ERROR(client->init(get_segment_file_url));
- client->set_timeout_ms(estimate_timeout * 1000); // 10ms
+ client->set_timeout_ms(estimate_timeout * 1000);
RETURN_IF_ERROR(client->download(local_segment_path));
std::error_code ec;
diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Syncer.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Syncer.groovy
index e8724bb097..805093ef4f 100644
--- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Syncer.groovy
+++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Syncer.groovy
@@ -680,7 +680,7 @@ class Syncer {
}
tarPartition.value.version = srcPartition.value.version
- long partitionId = fakePartitionId == -1 ? srcPartition.key : fakePartitionId
+ long partitionId = fakePartitionId == -1 ? tarPartition.key : fakePartitionId
long version = fakeVersion == -1 ? srcPartition.value.version : fakeVersion
TIngestBinlogRequest request = new TIngestBinlogRequest()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org