zmuxuny opened a new pull request, #7165:
URL: https://github.com/apache/rocketmq-dashboard/pull/7165

   ### Which Issue(s) This PR Fixes
   
   Fixes #7164.
   
   ### Brief Description
   
   Native reconciliation needs one event's metadata per active `(rule_id, 
fingerprint)`. Its batched query currently loads every matching historical 
event, including descriptions and other unused payloads, before reducing the 
result in Java. Normal successful collections repeat this work even when the 
resources are still present. Reminder history has no automatic event-retention 
bound.
   
   Select the newest event ID per exact active key with `ROW_NUMBER`, 
preserving `time DESC, id DESC` and the current domain/instance scope. Join 
only those IDs to retrieve rule, fingerprint, instance and labels. Keep the 
existing empty-state guard and one batched query; do not apply a global limit 
that could omit quieter active keys.
   
   This bounds the JDBC result and application-side metadata materialization by 
active keys. The database still scans/ranks historical scalar rows; this is not 
a constant-time database optimization. No schema, index, dependency, external 
API or event-retention policy changes.
   
   The native path generates canonical lowercase SHA-256 fingerprints. The 
query relies on that existing invariant: manually inserted case variants under 
a case-insensitive database collation are outside the tested compatibility 
contract.
   
   The earlier #2688/#2957 batching addressed N+1 round trips. #6195 bounds a 
public alert-list endpoint and #7021 handles acknowledged-state cleanup; this 
change addresses the remaining reconciliation result-volume boundary.
   
   ### How Did You Test This Change?
   
   Base: `rocketmq-studio@127c47b06a268cc74224d5f34c56ec7c36ac0d55`. Java 21, 
cached Maven dependencies offline, H2 2.4.240 in MySQL mode.
   
   - The same final real-MyBatis test file on unchanged production: **2 
regression failures, 2 controls pass**. Two active keys with 1,000/2,000 
retained events each materialized **2,002/4,002 mapper rows instead of 2**; 
latest-label assertions already passed, so final-map size alone would not catch 
this regression.
   - Fixed related suites: **56 tests across 5 classes pass**, including 
real-mapper row counts, equal timestamps resolved by ID, older/null timestamps, 
domain/instance isolation, inactive cross-pairs, missing events, empty active 
states, existing repository behavior, native processor/state machine and schema 
migration tests.
   - Maven Checkstyle: **0 violations**. `git diff --check`: pass.
   
   No live MySQL benchmark, broker/deployment run or full backend/frontend 
suite is claimed. MySQL 8 supports the window-query shape; runtime execution 
here was H2. The synthetic query audit also demonstrates why a global LIMIT is 
unsafe: LIMIT 5 represented only two of four applicable keys.
   
   AI assistance was used for investigation, implementation and validation. A 
separate automated review checked the actual diff and test evidence; no human 
or maintainer approval is claimed.
   
   ### Checklist
   
   - [x] One coherent change with real-mapper regressions and controls
   - [x] Conventional Commit subject; tests named `...Test`
   - [x] New test file has the existing ASF source header
   - [x] No new UI wording or public API
   - [ ] Full architecture/integration suite and live MySQL execution were not 
run
   


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