suxiaogang223 commented on code in PR #68837:
URL: https://github.com/apache/doris/pull/68837#discussion_r4246355208
##########
be/src/exec/sink/writer/paimon/paimon_table_writer.cpp:
##########
@@ -148,16 +160,14 @@ Status PaimonTableWriter::close(Status status) {
DORIS_CHECK(msg.__isset.payload);
COUNTER_UPDATE(_commit_payload_bytes_counter,
static_cast<int64_t>(msg.payload.size()));
}
- ThriftSerializer serializer(false, 256);
- for (auto& message : messages) {
- std::string commit_data;
- RETURN_IF_ERROR(serializer.serialize(&message, &commit_data));
-
RETURN_IF_ERROR(_state->add_connector_commit_data(std::move(commit_data)));
- }
- if (!messages.empty()) {
- LOG(INFO) << "Paimon writer closed: " << messages.size()
+ const size_t message_count = messages.size();
+ _state->publish_reserved_paimon_commit_messages(std::move(messages));
+ if (message_count > 0) {
+ LOG(INFO) << "Paimon writer closed: " << message_count
<< " commit messages, total rows=" << _written_rows;
}
+ } else {
+
_state->release_paimon_commit_message_reservation(commit_message_reservation);
Review Comment:
Fixed in 73d00eb9715. Replaced the manual reservation/release bookkeeping
with an RAII ExternalFileReportReservation. A reservation is consumed by
successful publication and automatically released on unpublished exit paths; a
writer closed before open never acquires a reservation or dereferences
RuntimeState. Added focused close-before-open and scope-exit coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]