wuchong commented on code in PR #2747:
URL: https://github.com/apache/fluss/pull/2747#discussion_r2867290839
##########
fluss-client/src/main/java/org/apache/fluss/client/write/RecordAccumulator.java:
##########
@@ -397,7 +405,22 @@ Deque<WriteBatch> getReadyDeque(PhysicalTablePath path,
int bucketId) {
return null;
}
- return bucketAndWriteBatches.batches.get(bucketId);
+ Deque<WriteBatch> writeBatches =
bucketAndWriteBatches.batches.get(tableBucket.getBucket());
+ if (tableBucket.getTableId() != bucketAndWriteBatches.tableId) {
+ LOG.warn(
+ "Table ID changed from {} to {} for table path {},
aborting stale batches.",
+ bucketAndWriteBatches.tableId,
+ tableBucket.getTableId(),
+ path);
+ InvalidTableException reason =
+ new InvalidTableException(
+ String.format(
+ "Table ID changed from %d to %d for table
path %s",
+ bucketAndWriteBatches.tableId,
tableBucket.getTableId(), path));
Review Comment:
1. Throw a `TableNotExistException` for this scenario and ensure
`stackTraceEnabled` is set to true when instantiating the exception.
2. Update the error message to explicitly state that the table has been
re-created, indicating that further writes to this table instance cannot
proceed.
--
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]