Caideyipi opened a new pull request, #18277:
URL: https://github.com/apache/iotdb/pull/18277

   ## Description
   
   ### Isolate consensus subscription metrics by Region
   
   Consensus subscription queues from different Regions can share the same 
consumer-group/topic queue ID. The metrics singleton previously keyed queues 
and rates only by that ID, so one Region overwrote or hid the others.
   
   This change keys metric state by (queue ID, Region ID), adds the region tag 
to every consensus-subscription metric, passes the Region when marking transfer 
rates, and removes only the matching Region's gauges and rate. Metric lifecycle 
operations are serialized and stale queue instances cannot deregister the 
active instance for the same key.
   
   ### Make catch-up status observable and accurate
   
   - Add subscription_consensus_active, subscription_consensus_initialized, and 
subscription_consensus_seek_generation.
   - Keep subscription_current_commit_id for dashboard compatibility while 
exposing its actual seek-generation meaning under the new metric name.
   - Include entries waiting in the linger batch in subscription_consensus_lag, 
so lag cannot report zero while accepted data is still waiting to be emitted.
   - Remove stale per-Region Rate objects during deregistration.
   
   For a stopped workload, an initialized active Region with zero lag now means 
the queue has no buffered, in-flight, pending, lingered, or unread WAL work.
   
   ### Verification
   
   - mvn -Ddevelocity.off=true spotless:apply -pl 
iotdb-core/node-commons,iotdb-core/datanode
   - mvn -Ddevelocity.off=true checkstyle:check -pl 
iotdb-core/node-commons,iotdb-core/datanode
   - Targeted unit tests: 12 tests, 0 failures/errors
     - ConsensusSubscriptionPrefetchingQueueMetricsTest
     - ConsensusPrefetchingQueueTest
   - English and Chinese full-reactor test-compile were attempted. Both stop 
before the changed modules because generated 
iotdb-thrift-commons/.../TaskType.java cannot resolve javax.annotation in the 
local environment.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
       - [x] concurrent read
       - [x] concurrent write
       - [x] concurrent read and write
   - [x] added comments explaining the why and the intent of the code wherever 
it would not be obvious.
   - [x] added unit tests or modified existing tests to cover new code paths.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - ConsensusSubscriptionPrefetchingQueueMetrics
   - ConsensusPrefetchingQueue
   - SubscriptionReceiverV1
   - Metric


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