Skip to content
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

[fix](snapshot) Link binlog files according to consistent rowsets #41319

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions be/src/olap/snapshot_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ Status SnapshotManager::_create_snapshot_files(const TabletSharedPtr& ref_tablet
string snapshot_id;
RETURN_IF_ERROR(io::global_local_filesystem()->canonicalize(snapshot_id_path, &snapshot_id));

std::vector<RowsetSharedPtr> consistent_rowsets;
do {
TabletMetaSharedPtr new_tablet_meta(new (nothrow) TabletMeta());
if (new_tablet_meta == nullptr) {
res = Status::Error<MEM_ALLOC_FAILED>("fail to malloc TabletMeta.");
break;
}
std::vector<RowsetSharedPtr> consistent_rowsets;
DeleteBitmap delete_bitmap_snapshot(new_tablet_meta->tablet_id());

/// If set missing_version, try to get all missing version.
Expand Down Expand Up @@ -628,17 +628,16 @@ Status SnapshotManager::_create_snapshot_files(const TabletSharedPtr& ref_tablet
}

RowsetBinlogMetasPB rowset_binlog_metas_pb;
if (request.__isset.missing_version) {
res = ref_tablet->get_rowset_binlog_metas(request.missing_version,
&rowset_binlog_metas_pb);
} else {
std::vector<TVersion> missing_versions;
res = ref_tablet->get_rowset_binlog_metas(missing_versions, &rowset_binlog_metas_pb);
}
if (!res.ok()) {
break;
for (auto& rs : consistent_rowsets) {
if (!rs->is_local()) {
continue;
}
res = ref_tablet->get_rowset_binlog_metas(rs->version(), &rowset_binlog_metas_pb);
if (!res.ok()) {
break;
}
}
if (rowset_binlog_metas_pb.rowset_binlog_metas_size() == 0) {
if (!res.ok() || rowset_binlog_metas_pb.rowset_binlog_metas_size() == 0) {
break;
}

Expand Down
Loading