[HUDI-4484] Add default lock config options for flink metadata table (#6222)
This commit is contained in:
@@ -267,14 +267,21 @@ public class HoodieFlinkWriteClient<T extends HoodieRecordPayload> extends
|
||||
if (this.metadataWriter == null) {
|
||||
initMetadataWriter();
|
||||
}
|
||||
// refresh the timeline
|
||||
try {
|
||||
// guard the metadata writer with concurrent lock
|
||||
this.txnManager.getLockManager().lock();
|
||||
|
||||
// Note: the data meta client is not refreshed currently, some code path
|
||||
// relies on the meta client for resolving the latest data schema,
|
||||
// the schema expects to be immutable for SQL jobs but may be not for non-SQL
|
||||
// jobs.
|
||||
this.metadataWriter.initTableMetadata();
|
||||
this.metadataWriter.update(metadata, instantTime, getHoodieTable().isTableServiceAction(actionType));
|
||||
// refresh the timeline
|
||||
|
||||
// Note: the data meta client is not refreshed currently, some code path
|
||||
// relies on the meta client for resolving the latest data schema,
|
||||
// the schema expects to be immutable for SQL jobs but may be not for non-SQL
|
||||
// jobs.
|
||||
this.metadataWriter.initTableMetadata();
|
||||
this.metadataWriter.update(metadata, instantTime, getHoodieTable().isTableServiceAction(actionType));
|
||||
} finally {
|
||||
this.txnManager.getLockManager().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user