Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions be/src/olap/delta_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ OLAPStatus DeltaWriter::close(google::protobuf::RepeatedPtrField<PTabletInfo>* t
}
RETURN_NOT_OK(_mem_table->close(_writer));

OLAPStatus res = OLAP_SUCCESS;
OLAPStatus res = _table->add_pending_version(_req.partition_id, _req.transaction_id, nullptr);
if (res != OLAP_SUCCESS && res != OLAP_ERR_PUSH_TRANSACTION_ALREADY_EXIST) {
return res;
}
//add pending data to tablet
RETURN_NOT_OK(_table->add_pending_version(_req.partition_id, _req.transaction_id, nullptr));
for (SegmentGroup* segment_group : _segment_group_vec) {
RETURN_NOT_OK(_table->add_pending_segment_group(segment_group));
RETURN_NOT_OK(segment_group->load());
Expand All @@ -208,7 +210,10 @@ OLAPStatus DeltaWriter::close(google::protobuf::RepeatedPtrField<PTabletInfo>* t
return res;
}

RETURN_NOT_OK(_new_table->add_pending_version(_req.partition_id, _req.transaction_id, nullptr));
res = _new_table->add_pending_version(_req.partition_id, _req.transaction_id, nullptr);
if (res != OLAP_SUCCESS && res != OLAP_ERR_PUSH_TRANSACTION_ALREADY_EXIST) {
return res;
}
for (SegmentGroup* segment_group : _new_segment_group_vec) {
RETURN_NOT_OK(_new_table->add_pending_segment_group(segment_group));
RETURN_NOT_OK(segment_group->load());
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/olap_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ OLAPStatus OLAPHeader::add_pending_version(
if (pending_delta(i).transaction_id() == transaction_id) {
LOG(WARNING) << "pending delta already exists in header."
<< "transaction_id: " << transaction_id;
return OLAP_ERR_HEADER_ADD_PENDING_DELTA;
return OLAP_ERR_PUSH_TRANSACTION_ALREADY_EXIST;
}
}

Expand Down