Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTO Task Overhaul (BugFix and Support to run multiple subtasks) #14623

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4ab1610
Adds Support of maxNumRowsPerTask in RealtimeToOfflineSegmentsTasksGe…
noob-se7en Dec 2, 2024
c71bcac
refactoring
noob-se7en Dec 2, 2024
d0ca568
nit
noob-se7en Dec 2, 2024
8db838b
nit
noob-se7en Dec 2, 2024
3233c33
fixes bug
noob-se7en Dec 2, 2024
65e6aef
adds initial logic
noob-se7en Dec 6, 2024
fd496bf
changes logic
noob-se7en Dec 6, 2024
fec0b65
fixes bug
noob-se7en Dec 6, 2024
11c84be
clean up
noob-se7en Dec 9, 2024
31b3960
clean up
noob-se7en Dec 9, 2024
aaa72e3
nit
noob-se7en Dec 9, 2024
2992595
addresses PR comment
noob-se7en Dec 9, 2024
58eb51c
nit
noob-se7en Dec 9, 2024
f4ed406
Alternate solution
noob-se7en Dec 9, 2024
07f831c
fixes bugs and nits
noob-se7en Dec 9, 2024
318e89e
lint fix
noob-se7en Dec 10, 2024
b8e0daf
fix multiple consecuritve failure scenrio
noob-se7en Dec 10, 2024
8e80c09
Merge branch 'master' of github.com:apache/pinot into origin/parallel…
noob-se7en Dec 12, 2024
30a9459
refactoring and clean up
noob-se7en Dec 12, 2024
d29af8d
refactoring
noob-se7en Dec 12, 2024
8bcbe0f
refactoring
noob-se7en Dec 12, 2024
01381a2
fixes tests
noob-se7en Dec 13, 2024
75fb4ba
nit
noob-se7en Dec 13, 2024
546f27e
nit
noob-se7en Dec 13, 2024
fae4aaa
nit
noob-se7en Dec 13, 2024
97e8c49
Fixes time window bug
noob-se7en Dec 13, 2024
4ddfbb1
refactoring
noob-se7en Dec 14, 2024
7d3fa68
adds conditions for edge cases
noob-se7en Dec 14, 2024
19b83c6
nit
noob-se7en Dec 14, 2024
68cc920
nit
noob-se7en Dec 14, 2024
84f471a
update
noob-se7en Dec 14, 2024
e365e91
revert time overlap change
noob-se7en Dec 15, 2024
1baf68e
fixes some edge cases
noob-se7en Dec 15, 2024
1754dbc
refactoring
noob-se7en Dec 16, 2024
ff4017e
fixes test
noob-se7en Dec 16, 2024
9d329bc
Adds code docs and clean up
noob-se7en Dec 16, 2024
21185e6
nit
noob-se7en Dec 16, 2024
324a4cf
updates code docs of metadata
noob-se7en Dec 16, 2024
0f27067
Adds test
noob-se7en Dec 16, 2024
0eba7cc
clean up
noob-se7en Dec 17, 2024
02b94fe
handles edge case
noob-se7en Dec 17, 2024
6405c35
Adds tests and clean up
noob-se7en Dec 17, 2024
f77e817
clean up
noob-se7en Dec 17, 2024
5cd9bdf
Merge branch 'master' of github.com:apache/pinot into origin/parallel…
noob-se7en Dec 17, 2024
592f65c
Updates integration test
noob-se7en Dec 17, 2024
cf97b6e
adds code docs
noob-se7en Dec 17, 2024
f2dcef2
handle edge case
noob-se7en Dec 17, 2024
b3cebb4
handle edge case
noob-se7en Dec 17, 2024
e8c1b9b
fixes bug
noob-se7en Dec 17, 2024
9eacf76
test
noob-se7en Dec 18, 2024
9a2eb80
handles edge case
noob-se7en Dec 18, 2024
32628d0
nit
noob-se7en Dec 18, 2024
cc70645
clean up
noob-se7en Dec 18, 2024
903d519
addresses PR comment
noob-se7en Dec 18, 2024
066d925
nit
noob-se7en Dec 18, 2024
66ff5ad
Refactor var names
noob-se7en Dec 23, 2024
b307458
nit
noob-se7en Dec 23, 2024
2d1f086
nit
noob-se7en Dec 23, 2024
f183b85
nit
noob-se7en Dec 23, 2024
46bbd20
minor edge cases
noob-se7en Dec 30, 2024
00cc1bc
nit
noob-se7en Dec 30, 2024
dca5736
fixes lintg
noob-se7en Dec 30, 2024
6040793
nit
noob-se7en Dec 30, 2024
8e418d8
Merge branch 'master' of github.com:apache/pinot into origin/parallel…
noob-se7en Jan 22, 2025
7380368
minor refactoring
noob-se7en Jan 22, 2025
f4371c2
throws exception if failed to delete invalid segment
noob-se7en Jan 22, 2025
d00ea27
Adds logs
noob-se7en Jan 22, 2025
1dda7ca
simplifies code
noob-se7en Jan 25, 2025
97846ff
nit
noob-se7en Jan 25, 2025
97bf146
Adds unit tests
noob-se7en Jan 25, 2025
b12980b
Adds unit tests
noob-se7en Jan 26, 2025
2cdc946
Fixes unit test
noob-se7en Jan 26, 2025
279a339
fixes integration test
noob-se7en Jan 26, 2025
bfad067
fixes log format output
noob-se7en Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,25 @@


/**
* Metadata for the minion task of type <code>RealtimeToOfflineSegmentsTask</code>.
* The <code>_windowStartMs</code> denotes the time (exclusive) until which it's certain that tasks have been
* completed successfully.
* The <code>_expectedSubtaskResultMap</code> contains the expected RTO tasks result info.
* This map can contain both completed and in-completed Tasks expected Results. This map is used by
* generator to validate whether a potential segment (for RTO task) has already been successfully
* processed as a RTO task in the past or not.
* The <code>_windowStartMs</code> and <code>_windowEndMs</code> denote the window bucket time
* of currently not successfully completed minion task. bucket: [_windowStartMs, _windowEndMs)
* The window is updated by generator when it's certain that prev minon task run is successful.
*
* Metadata for the minion task of type <code>RealtimeToOfflineSegmentsTask</code>. The <code>_windowStartMs</code>
* denotes the time (exclusive) until which it's certain that tasks have been completed successfully. The
* <code>_expectedSubtaskResultMap</code> contains the expected RTO tasks result info. This map can contain both
* completed and in-completed Tasks expected Results. This map is used by generator to validate whether a potential
* segment (for RTO task) has already been successfully processed as a RTO task in the past or not. The
* <code>_windowStartMs</code> and <code>_windowEndMs</code> denote the window bucket time of currently not
* successfully completed minion task. bucket: [_windowStartMs, _windowEndMs) The window is updated by generator when
* it's certain that prev minon task run is successful.
* <p>
* This gets serialized and stored in zookeeper under the path
* MINION_TASK_METADATA/${tableNameWithType}/RealtimeToOfflineSegmentsTask
*
* PinotTaskGenerator:
* The <code>_windowStartMs</code>> is used by the <code>RealtimeToOfflineSegmentsTaskGenerator</code>,
* to determine the window of execution of the prev task based on which it generates new task.
*
* PinotTaskExecutor:
* The same windowStartMs is used by the <code>RealtimeToOfflineSegmentsTaskExecutor</code>, to:
* <p>
* PinotTaskGenerator: The <code>_windowStartMs</code>> is used by the
* <code>RealtimeToOfflineSegmentsTaskGenerator</code>, to determine the window of execution of the prev task based on
* which it generates new task.
* <p>
* PinotTaskExecutor: The same windowStartMs is used by the <code>RealtimeToOfflineSegmentsTaskExecutor</code>, to:
* - Verify that it's running the latest task scheduled by the task generator.
* - The _expectedSubtaskResultMap is updated before the offline segments
* are uploaded to the table.
* - The _expectedSubtaskResultMap is updated before the offline segments are uploaded to the table.
*/
public class RealtimeToOfflineSegmentsTaskMetadata extends BaseTaskMetadata {

Expand Down Expand Up @@ -146,26 +142,30 @@ public static RealtimeToOfflineSegmentsTaskMetadata fromZNRecord(ZNRecord znReco
new HashMap<>();
Map<String, List<String>> listFields = znRecord.getListFields();

for (Map.Entry<String, List<String>> listField : listFields.entrySet()) {
String expectedSubtaskResultId = listField.getKey();
if (listFields != null) {
for (Map.Entry<String, List<String>> listField : listFields.entrySet()) {
String expectedSubtaskResultId = listField.getKey();

List<String> value = listField.getValue();
Preconditions.checkState(value.size() == 4);
List<String> value = listField.getValue();
Preconditions.checkState(value.size() == 4);

List<String> segmentsFrom = Arrays.asList(StringUtils.split(value.get(0), COMMA_SEPARATOR));
List<String> segmentsTo = Arrays.asList(StringUtils.split(value.get(1), COMMA_SEPARATOR));
String taskID = value.get(2);
boolean taskFailure = Boolean.parseBoolean(value.get(3));
List<String> segmentsFrom = Arrays.asList(StringUtils.split(value.get(0), COMMA_SEPARATOR));
List<String> segmentsTo = Arrays.asList(StringUtils.split(value.get(1), COMMA_SEPARATOR));
String taskID = value.get(2);
boolean taskFailure = Boolean.parseBoolean(value.get(3));

expectedSubtaskResultMap.put(expectedSubtaskResultId,
new ExpectedSubtaskResult(segmentsFrom, segmentsTo, expectedSubtaskResultId, taskID,
taskFailure)
);
expectedSubtaskResultMap.put(expectedSubtaskResultId,
new ExpectedSubtaskResult(segmentsFrom, segmentsTo, expectedSubtaskResultId, taskID,
taskFailure)
);
}
}

Map<String, Map<String, String>> mapFields = znRecord.getMapFields();
Map<String, String> segmentNameToExpectedSubtaskResultID = mapFields.get(
SEGMENT_NAME_TO_EXPECTED_SUBTASK_RESULT_ID_KEY);
Map<String, String> segmentNameToExpectedSubtaskResultID = new HashMap<>();
if (mapFields != null) {
segmentNameToExpectedSubtaskResultID = mapFields.get(SEGMENT_NAME_TO_EXPECTED_SUBTASK_RESULT_ID_KEY);
}

return new RealtimeToOfflineSegmentsTaskMetadata(znRecord.getId(), windowStartMs, windowEndMs,
expectedSubtaskResultMap, segmentNameToExpectedSubtaskResultID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class RealtimeToOfflineSegmentsTaskGenerator extends BaseTaskGenerator {

private static final String DEFAULT_BUCKET_PERIOD = "1d";
private static final String DEFAULT_BUFFER_PERIOD = "2d";
private static final int DEFAULT_MAX_NUM_RECORDS_PER_TASK = 50_000_000;
private static final int DEFAULT_MAX_NUM_RECORDS_PER_TASK = Integer.MAX_VALUE;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important for case where this PR is deployed to controller first.


@Override
public String getTaskType() {
Expand Down
Loading