Repository navigation
Metadata sync unified view - #14260
vamsikarnika wants to merge 27 commits into
Conversation
nsivabalan
left a comment
There was a problem hiding this comment.
will review the rest once you push all your latest changes
|
|
||
| // Records which save the file listing of each partition | ||
| engineContext.setJobStatus(this.getClass().getSimpleName(), "Creating records for metadata FILES partition"); | ||
| boolean enableBasePathForPartitions = dataWriteConfig.shouldEnableBasePathForPartitions(); |
There was a problem hiding this comment.
once we have the new sub class, we should try and avoid making any changes to this class.
There was a problem hiding this comment.
This class is still used in the incremental flow.
| ] | ||
| }, | ||
| { | ||
| "name": "basePathForPartition", |
There was a problem hiding this comment.
lets fix this one as well. "basePathOverride"
There was a problem hiding this comment.
Will address them in the next commits
| .withPopulateMetaFields(metaClient.getTableConfig().populateMetaFields()) | ||
| .withEmbeddedTimelineServerEnabled(false) | ||
| .withSchema(schema == null ? "" : schema.toString()) | ||
| .withArchivalConfig( |
There was a problem hiding this comment.
oh for target table, cleaner is a no op right.
So, only archival matters.
lets ensure we take inputs from spark submit command use it.
may be by default, having 120 commits in activetimeline is fine.
nsivabalan
left a comment
There was a problem hiding this comment.
sharing reviews in 2 latest commits.
yet to review tests.
| } | ||
|
|
||
| // initialize metadata writer | ||
| List<DirectoryInfo> partitionInfoList = listAllPartitionsFromFilesystem(lastInstantTimestamp, sourceBasePath); |
There was a problem hiding this comment.
if metadata table is enabled in the source table, shouldn't we be calling listAllPartitionsFromMDT(...)
There was a problem hiding this comment.
Yes, I'm yet to add this functionality. Couldn't get to this yet.
| Option<String> inflightInstantTimestamp) throws IOException { | ||
| // Do not initialize the metadata table during metadata sync | ||
| metadataMetaClient = initializeMetaClient(); | ||
| this.metadata = new HoodieBackedTableMetadata(engineContext, dataWriteConfig.getMetadataConfig(), dataWriteConfig.getBasePath(), true); |
There was a problem hiding this comment.
don't we need to initialize initMetadataReader() if FILES partition is already bootstrapped?
There was a problem hiding this comment.
Will get back on this
| .reloadActiveTimeline() | ||
| .saveAsComplete(new HoodieInstant(true, instant.getAction(), commitTime), commitMetadataInBytes); | ||
| } | ||
| private void runArchiver( |
There was a problem hiding this comment.
don't we need a lock here?
what if two concurrent writer tries to archive the target table concurrently
There was a problem hiding this comment.
I think Archival Job handles locks internally? Do we need explicitly set the lock? Need to check code. For now. I'll move this code into the synchronized block
nsivabalan
left a comment
There was a problem hiding this comment.
reviewed most of source code.
will review rest tomorrow.
| import java.util.stream.Collectors; | ||
| import java.util.stream.Stream; | ||
|
|
||
| public class SparkHoodieBackedMetadataSyncMetadataWriter extends SparkHoodieBackedTableMetadataWriter { |
There was a problem hiding this comment.
do we have tests for this class directly?
There was a problem hiding this comment.
Not currently. This is covered through FTs though for bootstrap sync
| Option.of(triggeringInstantTimestamp)); | ||
| HoodieTableMetadataWriter metadataWriter; | ||
| if (config.shouldEnableBootstrapMetadataSync()) { | ||
| metadataWriter = SparkHoodieBackedMetadataSyncMetadataWriter.create( |
There was a problem hiding this comment.
why do we need this change?
we are directly instantiating SparkHoodieBackedMetadataSyncMetadataWriter within HoodieMetadataSync right.
So, why we need these changes.
There was a problem hiding this comment.
No, we're relying on sparkTable to provide this metadata new writer..
| : fullPartitionPathStr.substring(partitionStartIndex + basePath.getName().length() + 1); | ||
| } | ||
|
|
||
| public static String getRelativePartitionPath(Path fullPartitionPath, int numPartitionPathLevels) { |
There was a problem hiding this comment.
do we have UTs for this
| Option<String> tableSyncMetadataJson = Option.ofNullable(commitMetadata.getMetadata(SyncMetadata.TABLE_SYNC_METADATA)); | ||
| if (!tableSyncMetadataJson.isPresent()) { | ||
| // if table sync metadata is not present, sync all commits from source table | ||
| throw new HoodieException("Table sync metadata is missing in the target table commit metadata"); |
|
@vamsikarnika : have you chased all test failures? how far are we before we can get CI green |
|
Temporarily closing this PR while we debug a GitHub settings error on master (#20471); it will be reopened shortly, no action needed. |
Describe the issue this Pull Request addresses
Summary and Changelog
Impact
Risk Level
Documentation Update
Contributor's checklist