JingsongLi commented on code in PR #10133:
URL: https://github.com/apache/paimon/pull/10133#discussion_r4180024009


##########
paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreWrite.java:
##########
@@ -642,7 +652,12 @@ long startingMaxSequenceNumber(long restoredMaxSeqNumber, 
@Nullable Snapshot lat
 
     @Override
     public FileStoreWrite<T> withMetricRegistry(MetricRegistry metricRegistry) 
{
-        this.compactionMetrics = new CompactionMetrics(metricRegistry, 
tableName);
+        this.compactionMetrics =
+                new CompactionMetrics(
+                        metricRegistry,
+                        tableName,
+                        options.compactionTaskExecutorMode()
+                                == CompactionTaskExecutorMode.PER_BUCKET);

Review Comment:
   [P2] Base timer retirement on the actual executor ownership
   
   This enables reporter timer retirement from the configured PER_BUCKET mode 
even when withCompactExecutor overrides routing with a shared external pool 
(compactExecutor checks the external override first). CDC multi-table writes 
use this API and install metrics before the external executor. Two bucket 
reporters can therefore use the same worker timer; closing an idle bucket 
removes that timer while another bucket is compacting. With the actual 
table.newWrite()/metrics/external single-thread executor API I reproduced 
compactionThreadBusy changing from ~50% to 0 and the other reporter finish 
throwing "There is no unfinished interval"; configurations 1 and 2 preserve 
~50% and finish normally. Both API call orders reproduce it. CompactTask 
safeCall contains the exception, so compaction data still succeeds, but the 
monitoring metric loses ongoing/recent activity and emits warnings. Retire 
timers only for internally owned per-bucket executors, including when the 
external override is inst
 alled after metrics, and cover this shared-external case.



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