SteNicholas commented on code in PR #269:
URL: https://github.com/apache/paimon-cpp/pull/269#discussion_r3923895604


##########
src/paimon/core/realtime/realtime_primary_key_writer.cpp:
##########
@@ -245,15 +235,15 @@ Result<CommitIncrement> 
RealtimePrimaryKeyWriter::PrepareCommit(bool wait_compac
     return increment;
 }
 
-Status RealtimePrimaryKeyWriter::FlushSegment(const 
std::shared_ptr<RealtimeSegmentHandle>& segment,
-                                              const OffsetRange& 
sealed_offsets) {
+Status RealtimePrimaryKeyWriter::FlushSegment(
+    const std::shared_ptr<RealtimeSegmentHandle>& segment) {
+    // TODO(xinyu.lxy): Validate row count from commit readers.

Review Comment:
   `GetRowCount()` was added because sparse offset envelopes no longer encode 
cardinality, but this path never compares the raw rows returned by 
`CreateCommitReaders()` with the segment count. A store that drops or 
duplicates a mutation can therefore pass through MOR, publish files, and 
advance the committed offset past data that was never persisted. Please add 
shared counting around the raw reader streams and fail at EOF unless the total 
equals `segment->GetRowCount()`, as the append path already does.



-- 
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]

Reply via email to