-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-2285] Metadata Table synchronous design #3426
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
Changes from all commits
985ae86
e85c712
d683122
690ea20
47c3000
b658779
12d6eb5
f417390
fdc267c
59cd841
21e8d70
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 |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ | |
| import org.apache.hudi.exception.HoodieRollbackException; | ||
| import org.apache.hudi.exception.HoodieSavepointException; | ||
| import org.apache.hudi.index.HoodieIndex; | ||
| import org.apache.hudi.metadata.HoodieTableMetadataWriter; | ||
| import org.apache.hudi.metrics.HoodieMetrics; | ||
| import org.apache.hudi.table.BulkInsertPartitioner; | ||
| import org.apache.hudi.table.HoodieTable; | ||
|
|
@@ -187,6 +188,7 @@ public boolean commitStats(String instantTime, List<HoodieWriteStat> stats, Opti | |
| lastCompletedTxnAndMetadata.isPresent() ? Option.of(lastCompletedTxnAndMetadata.get().getLeft()) : Option.empty()); | ||
| try { | ||
| preCommit(instantTime, metadata); | ||
| table.getMetadataWriter().ifPresent(w -> ((HoodieTableMetadataWriter)w).update(metadata, instantTime)); | ||
| commit(table, commitActionType, instantTime, metadata, stats); | ||
| postCommit(table, metadata, instantTime, extraMetadata); | ||
| LOG.info("Committed " + instantTime); | ||
|
|
@@ -241,10 +243,6 @@ protected void preCommit(String instantTime, HoodieCommitMetadata metadata) { | |
| // TODO : Conflict resolution is not supported for Flink & Java engines | ||
| } | ||
|
|
||
| protected void syncTableMetadata() { | ||
| // no-op | ||
| } | ||
|
|
||
| /** | ||
| * Filter out HoodieRecords that already exists in the output folder. This is useful in deduplication. | ||
| * | ||
|
|
@@ -399,14 +397,6 @@ protected void preWrite(String instantTime, WriteOperationType writeOperationTyp | |
| HoodieTableMetaClient metaClient) { | ||
| setOperationType(writeOperationType); | ||
| this.lastCompletedTxnAndMetadata = TransactionUtils.getLastCompletedTxnInstantAndMetadata(metaClient); | ||
| this.txnManager.beginTransaction(Option.of(new HoodieInstant(State.INFLIGHT, metaClient.getCommitActionType(), instantTime)), lastCompletedTxnAndMetadata | ||
|
Member
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. nts: this lock was only being taken for purposes of syncing. So removing this is fine. |
||
| .isPresent() | ||
| ? Option.of(lastCompletedTxnAndMetadata.get().getLeft()) : Option.empty()); | ||
| try { | ||
| syncTableMetadata(); | ||
| } finally { | ||
| this.txnManager.endTransaction(); | ||
| } | ||
| this.asyncCleanerService = AsyncCleanerService.startAsyncCleaningIfEnabled(this); | ||
| } | ||
|
|
||
|
|
@@ -435,7 +425,6 @@ protected void postCommit(HoodieTable<T, I, K, O> table, HoodieCommitMetadata me | |
| HoodieTimelineArchiveLog archiveLog = new HoodieTimelineArchiveLog(config, table); | ||
| archiveLog.archiveIfRequired(context); | ||
| autoCleanOnCommit(); | ||
| syncTableMetadata(); | ||
|
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. why remove the metadata table sync?
Member
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. there is no more additional sync process, with this re-design. |
||
| } catch (IOException ioe) { | ||
| throw new HoodieIOException(ioe.getMessage(), ioe); | ||
| } finally { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nts: first committing to metadata table