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

   ## Summary
   - add separate metric snapshot lookup indexes for cluster-scoped and global 
native alert aggregation
   - keep the collected_at retention index for snapshot cleanup
   - cover both fresh schema.sql and AlertSchemaMigration idempotent upgrade 
behavior
   
   ## MySQL query-plan expectation
   Native alert aggregation filters by instance_id, metric_key, domain, 
labels_hash, availability and collected_at. Cluster-scoped rules also filter 
cluster_id. The new indexes keep all equality predicates before collected_at 
for both query shapes:
   - cluster-scoped: instance_id, metric_key, domain, labels_hash, cluster_id, 
availability, collected_at
   - global: instance_id, metric_key, domain, labels_hash, availability, 
collected_at
   
   This avoids using one cluster_id-first index for global rules, where the 
missing cluster_id predicate would prevent later equality/range parts from 
being used effectively.
   
   Closes #2682
   
   ## Verification
   - RED: JAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -q 
-Dtest=AlertSchemaMigrationTest test failed before implementation because both 
new indexes were missing
   - JAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -q 
-Dtest=AlertSchemaMigrationTest,DemoDataSqlCompatibilityTest test
   - JAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -q -DskipTests compile
   - git diff --check
   - MySQL 8.0 temporary container executed 
server/src/main/resources/db/schema.sql and verified 
INFORMATION_SCHEMA.STATISTICS column order for 
idx_metric_snapshot_scope_cluster, idx_metric_snapshot_scope_global and 
idx_metric_snapshot_retention


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