Skip to content

Commit

Permalink
[Refactor] Add error messages in cross-cluster replication (backport #…
Browse files Browse the repository at this point in the history
…53228) (#53253)

Co-authored-by: xiangguangyxg <[email protected]>
  • Loading branch information
mergify[bot] and xiangguangyxg authored Nov 27, 2024
1 parent 5073c96 commit 60ae012
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions be/src/storage/lake/replication_txn_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ Status ReplicationTxnManager::replicate_remote_snapshot(const TReplicateSnapshot
auto status = tablet_meta.create_from_memory(header_file_content);
if (!status.ok()) {
LOG(WARNING) << "Failed to parse remote snapshot header file: " << remote_header_file_name
<< ", content: " << header_file_content << ", " << status;
return status;
<< ", content: " << header_file_content << ", status: " << status;
return status.clone_and_prepend("Failed to parse remote snapshot header file: " + remote_header_file_name +
", content: " + header_file_content + ", status");
}

const auto& rowset_metas =
Expand All @@ -282,8 +283,9 @@ Status ReplicationTxnManager::replicate_remote_snapshot(const TReplicateSnapshot
auto status = snapshot_meta.parse_from_file(memory_file.get());
if (!status.ok()) {
LOG(WARNING) << "Failed to parse remote snapshot meta file: " << snapshot_meta_file_name
<< ", content: " << snapshot_meta_content << ", " << status;
return status;
<< ", content: " << snapshot_meta_content << ", status: " << status;
return status.clone_and_prepend("Failed to parse remote snapshot meta file: " + snapshot_meta_file_name +
", content: " + snapshot_meta_content + ", status");
}

DCHECK(((src_snapshot_info.incremental_snapshot &&
Expand Down
12 changes: 7 additions & 5 deletions be/src/storage/replication_txn_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Status ReplicationTxnManager::publish_txn(TTransactionId transaction_id, TPartit
if (!status.ok()) {
LOG(WARNING) << "Failed to publish snapshot: " << snapshot_dir_path << ", tablet_id: " << tablet->tablet_id()
<< ", partition_id: " << partition_id << ", txn_id: " << transaction_id << ", status: " << status;
};
}
return status;
}

Expand Down Expand Up @@ -456,8 +456,9 @@ Status ReplicationTxnManager::replicate_remote_snapshot(const TReplicateSnapshot
auto status = tablet_meta.create_from_memory(header_file_content);
if (!status.ok()) {
LOG(WARNING) << "Failed to parse remote snapshot header file: " << remote_header_file_name
<< ", content: " << header_file_content << ", " << status;
return status;
<< ", content: " << header_file_content << ", status: " << status;
return status.clone_and_prepend("Failed to parse remote snapshot header file: " + remote_header_file_name +
", content: " + header_file_content + ", status");
}
// None-pk table always has tablet schema in tablet meta
source_schema = std::move(tablet_meta.tablet_schema_ptr());
Expand All @@ -474,8 +475,9 @@ Status ReplicationTxnManager::replicate_remote_snapshot(const TReplicateSnapshot
auto status = snapshot_meta.parse_from_file(memory_file.get());
if (!status.ok()) {
LOG(WARNING) << "Failed to parse remote snapshot meta file: " << snapshot_meta_file_name
<< ", content: " << snapshot_meta_content << ", " << status;
return status;
<< ", content: " << snapshot_meta_content << ", status: " << status;
return status.clone_and_prepend("Failed to parse remote snapshot meta file: " + snapshot_meta_file_name +
", content: " + snapshot_meta_content + ", status");
}

DCHECK(((src_snapshot_info.incremental_snapshot &&
Expand Down

0 comments on commit 60ae012

Please sign in to comment.