Use task actions to fetch used segments in MSQ#15284
Conversation
|
@AmatyaAvadhanula , are more changes pending in this PR? |
|
@kfaraz, yes, there are several failing tests which need to be fixed. |
| // If the task is operating with a REPLACE lock, | ||
| // any segment created after the lock was acquired for its interval will not be considered. | ||
| final Collection<DataSegment> publishedUsedSegments = new HashSet<>(); | ||
| for (Interval interval : intervals) { |
There was a problem hiding this comment.
Looking at RetrieveSegmentsToReplaceAction and the method IndexerMetadataStorageConnector.retrieveUsedSegmentsAndCreatedDates, I suppose we could just pass a list of intervals to the action rather than firing a separate action for each interval.
This reverts commit 95ab649
kfaraz
left a comment
There was a problem hiding this comment.
Minor feedback which can be addressed in a later PR, otherwise LGTM.
| } | ||
| } else if (taskAction instanceof RetrieveSegmentsToReplaceAction) { | ||
| String dataSource = ((RetrieveSegmentsToReplaceAction) taskAction).getDataSource(); | ||
| return (RetType) injector.getInstance(SpecificSegmentsQuerySegmentWalker.class) |
There was a problem hiding this comment.
Could you please add a comment here explaining why we need to use the QuerySegmentWalker here instead of how we handle RetrieveUsedSegmentsAction here or how we would respond to the coordinatorClient().fetchUsedSegments() in MSQ tests?
* Use task actions to fetch used segments in MSQ * Fix tests * Fixing tests. * Revert "Fix tests" This reverts commit 95ab649 * Removing conditional check in tests. * Pulling in latest changes. --------- Co-authored-by: cryptoe <karankumar1100@gmail.com>
* Use task actions to fetch used segments in MSQ * Fix tests * Fixing tests. * Revert "Fix tests" This reverts commit 95ab649 * Removing conditional check in tests. * Pulling in latest changes. --------- Co-authored-by: cryptoe <karankumar1100@gmail.com>
#15220 Introduced a new
RetrieveSegmentsToReplaceaction to be used in the DruidInputSource.This PR lets the MSQ Controller use this action in ControllerImpl#makeDataSegmentTimelineView, to allow a consistent set of segments to be returned, especially with a REPLACE lock.