-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[feature](routineload) Add routine load target-table alter support #64878
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
base: master
Are you sure you want to change the base?
Changes from all commits
fb5a55b
03cf626
a8bd6be
9b2cf36
760890d
931b717
48f1b8c
0f1be9e
4a34f9f
000c838
cd0cd0c
cfb7382
bd1fad5
77cb200
e848c18
8b19f60
e93f300
0f81dc7
ba918d0
a756d7c
0fca4e7
04a5e10
963ed3e
66a665c
e589ea0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -782,9 +782,12 @@ public void modifyProperties(AlterRoutineLoadCommand command) throws UserExcepti | |
| } | ||
|
|
||
| modifyPropertiesInternal(jobProperties, dataSourceProperties); | ||
| if (command.hasTargetTable()) { | ||
| tableId = command.getTargetTableId(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Re-seed progress when a broker-list change selects a different Kafka cluster. With the topic unchanged, modifyPropertiesInternal() only replaces brokerList; it retains progress, custom/current partitions, and the latest-offset cache. Pinned jobs then skip metadata discovery, and a dynamic job whose new cluster has the same numeric partition IDs appears unchanged, so tasks combine the new brokers and target here with offsets from the old cluster. Switching cluster A at offset 1000 to cluster B can therefore skip B's first 1000 records or pause with OFFSET_OUT_OF_RANGE. Resolve the cluster ID and any requested offsets against the effective new brokers outside the job lock; if the cluster changed, require those validated offsets or reset/reseed all progress and partition caches, persist that prepared decision for replay, and recheck the job generation before committing.
0AyanamiRei marked this conversation as resolved.
0AyanamiRei marked this conversation as resolved.
|
||
| } | ||
|
|
||
| AlterRoutineLoadJobOperationLog log = new AlterRoutineLoadJobOperationLog(this.id, | ||
| jobProperties, dataSourceProperties); | ||
| jobProperties, dataSourceProperties, command.getTargetTableId()); | ||
| Env.getCurrentEnv().getEditLog().logAlterRoutineLoadJob(log); | ||
| } finally { | ||
| writeUnlock(); | ||
|
|
@@ -908,6 +911,9 @@ private void resetCloudProgress(Cloud.ResetRLProgressRequest.Builder builder) th | |
| public void replayModifyProperties(AlterRoutineLoadJobOperationLog log) { | ||
| try { | ||
| modifyPropertiesInternal(log.getJobProperties(), (KafkaDataSourceProperties) log.getDataSourceProperties()); | ||
| if (log.getTargetTableId() != 0) { | ||
|
0AyanamiRei marked this conversation as resolved.
|
||
| tableId = log.getTargetTableId(); | ||
| } | ||
| } catch (UserException e) { | ||
| // should not happen | ||
| LOG.error("failed to replay modify kafka routine load job: {}", id, e); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.