github-actions[bot] commented on code in PR #68837:
URL: https://github.com/apache/doris/pull/68837#discussion_r4246207066
##########
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:
[P1] Skip reservation release when the writer has never opened.
PaimonTableSinkLocalState creates this writer in init(), while _state is
assigned only by open(). If an INSERT is cancelled while its sink task is
queued, TaskScheduler closes the task before execute()/open();
PipelineTask::close still calls the sink close, which reaches this error branch
with _state == nullptr and a zero reservation. The new call dereferences the
null state and crashes the BE. Release only an acquired reservation, or give
the writer a valid runtime state during construction.
--
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]