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

[HUDI-6005] Auto generate client id for Flink multi writer #8323

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

danny0405
Copy link
Contributor

Change Logs

The current flink does not have a good msg notification mechanism from JM to TM tasks. In order to get rid of this, we introduced two kind of fs based messages on the JM:

  1. the view_storage_conf file to keep remote fs view storage properties
  2. the ckp_metadata used for pending instants fetching in light-weight way

Both of the two messages work well on single-writer scenario, we just use a fixed name file path for these files/directories. But in multi-writer scenario, writing into same name msg file incurs conflicts, the msg file finally got corrupted and the existing writers can be impacted.

In HUDI-5673, we introduced an option 'write.client.id' for manual conflict resolution, the user needs to config the client id for each of the multi-writers. This is valid but very inconvenient in production practice.

In this patch, we try to auto infer the client id when the job is submitted from the client machine. On start up, each job tries to scramble for a client id first, after the job is running, the coordinator on JM would try to send a heartbeat message for its client id in a fixed time interval(by default 1 minute).

The heartbeat is mainly used for deciding whether the job that holds the client id is still alive, if not, the client id can be recycled and reused.

Impact

no impact

Risk level (write none, low medium or high below)

none

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

The current flink does not have a good msg notification mechanism from JM to TM tasks.
In order to get rid of this, we introduced two kind of fs based messages on the JM:

1. the view_storage_conf file to keep remote fs view storage properties
2. the ckp_metadata used for pending instants fetching in light-weight way

Both of the two messages work well on single-writer scenario, we just use a fixed name file path for
these files/directories. But in multi-writer scenario, writing into same name msg file incurs conflicts,
the msg file finally got corrupted and the existing writers can be impacted.

In HUDI-5673, we introduced an option 'write.client.id' for manual conflict resolution, the user needs to
config the client id for each of the multi-writers. This is valid but very inconvenient in production practice.

In this patch, we try to auto infer the client id when the job is submitted from the client machine.
On start up, each job tries to scramble for a client id first, after the job is running, the coordinator on JM
would try to send a heartbeat message for its client id in a fixed time interval(by default 1 minute).

The heartbeat is mainly used for deciding whether the job that holds the client id is still alive, if not, the client id
can be recycled and reused.
@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 merged commit 4b995a8 into apache:master Mar 31, 2023
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
The current flink does not have a good msg notification mechanism from JM to TM tasks.
In order to get rid of this, we introduced two kind of fs based messages on the JM:

1. the view_storage_conf file to keep remote fs view storage properties
2. the ckp_metadata used for pending instants fetching in light-weight way

Both of the two messages work well on single-writer scenario, we just use a fixed name file path for
these files/directories. But in multi-writer scenario, writing into same name msg file incurs conflicts,
the msg file finally got corrupted and the existing writers can be impacted.

In HUDI-5673, we introduced an option 'write.client.id' for manual conflict resolution, the user needs to
config the client id for each of the multi-writers. This is valid but very inconvenient in production practice.

In this patch, we try to auto infer the client id when the job is submitted from the client machine.
On start up, each job tries to scramble for a client id first, after the job is running, the coordinator on JM
would try to send a heartbeat message for its client id in a fixed time interval(by default 1 minute).

The heartbeat is mainly used for deciding whether the job that holds the client id is still alive, if not, the client id
can be recycled and reused.
stayrascal pushed a commit to stayrascal/hudi that referenced this pull request Apr 20, 2023
The current flink does not have a good msg notification mechanism from JM to TM tasks.
In order to get rid of this, we introduced two kind of fs based messages on the JM:

1. the view_storage_conf file to keep remote fs view storage properties
2. the ckp_metadata used for pending instants fetching in light-weight way

Both of the two messages work well on single-writer scenario, we just use a fixed name file path for
these files/directories. But in multi-writer scenario, writing into same name msg file incurs conflicts,
the msg file finally got corrupted and the existing writers can be impacted.

In HUDI-5673, we introduced an option 'write.client.id' for manual conflict resolution, the user needs to
config the client id for each of the multi-writers. This is valid but very inconvenient in production practice.

In this patch, we try to auto infer the client id when the job is submitted from the client machine.
On start up, each job tries to scramble for a client id first, after the job is running, the coordinator on JM
would try to send a heartbeat message for its client id in a fixed time interval(by default 1 minute).

The heartbeat is mainly used for deciding whether the job that holds the client id is still alive, if not, the client id
can be recycled and reused.
KnightChess pushed a commit to KnightChess/hudi that referenced this pull request Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants