kfaraz commented on code in PR #19672:
URL: https://github.com/apache/druid/pull/19672#discussion_r3572566366
##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -663,6 +669,16 @@ protected void alterSegmentTable()
"IDX_%S_DATASOURCE_UPGRADED_FROM_SEGMENT_ID",
List.of("dataSource", "upgraded_from_segment_id")
);
+ // Migration for existing tables: covering index backing the used-segment
ID
+ // scan on every cache sync (see createSegmentTable).
+ createIndex(
+ tableName,
+ "IDX_%S_USED_USLU_DATASOURCE",
+ List.of("used", "used_status_last_updated", "dataSource", "id")
+ );
+ // The covering index above leads with 'used', so it supersedes the
single-column
+ // IDX_%S_USED. Drop the now-redundant index on existing tables.
+ dropIndex(tableName, "IDX_%S_USED", List.of("used"));
Review Comment:
Valid point, but this applies to all existing indices too.
We will need to create a fallback mechanism whenever an index fails to get
created.
The existing fallback is on Coordinator/Overlord restart, when the creation
of the index would be retried.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]