Skip to content

Conversation

@suryaprasanna
Copy link
Contributor

@suryaprasanna suryaprasanna commented Jun 7, 2023

Change Logs

Apart from the Logcompaction table service this change also contains other bug fixes to metadata table.
Following are the changes present.

  1. Change cleaner policy to KEEP_LATEST_FILE_VERSIONS for metadata table
  2. Added logs statements
  3. Fix rollback of inflight deltacommits on metadata table
  4. Add log statements to LogCompaction planner
  5. Integrate logcompaction table service on metadata table
  6. Include checks to block Logcompaction in presence of compaction with greater timestamp
  7. Use instant range option for major and minor compaction on metadata table

Impact

The changes contains bug fixes to metadata table and new feature request to integrate with logcompaction. So, impact is around the metadata table.

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

Medium

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

@suryaprasanna suryaprasanna changed the title Integrate logcompaction table service on metadata table and provides various bugfixes to metadata table Integrate logcompaction table service to metadata table and provides various bugfixes to metadata table Jun 7, 2023
@suryaprasanna suryaprasanna changed the title Integrate logcompaction table service to metadata table and provides various bugfixes to metadata table [HUDI-6334] Integrate logcompaction table service to metadata table and provides various bugfixes to metadata table Jun 7, 2023
@suryaprasanna suryaprasanna force-pushed the pr2-changes branch 2 times, most recently from fe74a9a to f9e3b8d Compare June 9, 2023 01:41
@nsivabalan nsivabalan added release-0.14.0 priority:critical Production degraded; pipelines stalled labels Jun 9, 2023
// test metadata table compaction
// write another 4 commits
for (int i = 1; i < 5; i++) {
// write another 9 commits to trigger compaction twice. Since default clean version to retain is 2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danny0405 : can you review changes in flink classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would rather prefer to set the clean version to retain as 1. Doing 9 commits is going to add to test time which is already quite high.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to change the clean strategy then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean's retainFileVersions value is changed to 2 and it is actually hardcoded in HoodieMetadataWriteUtils and both Spark and Flink gets the writeConfig using this. So, this cannot be overridden.
The reason for making the change is to support restore of main table timeline for atleast 10 commits. Restore on main table also causes restore on metadata table. If the retainFileVersions is less than 2, then next cleaner job after compaction would remove previous file slice there by blocking restore on metadata table or loosing data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for making the change is to support restore

First of all, I'm confused why this change is related with restore ? The change is for MDT log compaction right? Can we address the restore issue in another PR ?

then next cleaner job after compaction would remove previous file slice there by blocking restore on metadata table or loosing data.

Does the new cleaning strategy solve the issue, even we keep at least 2 versions for each file group, it does not ensure we can restore to a long history commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, reverting this change.

});

// SOLO_COMMIT_TIMESTAMP is used during bootstrap so it is a valid timestamp
validInstantTimestamps.add(SOLO_COMMIT_TIMESTAMP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But any MDT partition initialization instant timestamp is of the format SOLO_COMMIT_TIMESTAMP + 3-digit suffix, e.g. 00000000000000010 for FILES partition. How to account for the suffix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. good catch. we need to account for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, updated it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are couple of other places too. I've fixed it in #8915

// test metadata table compaction
// write another 4 commits
for (int i = 1; i < 5; i++) {
// write another 9 commits to trigger compaction twice. Since default clean version to retain is 2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would rather prefer to set the clean version to retain as 1. Doing 9 commits is going to add to test time which is already quite high.

// test metadata table compaction
// write another 4 commits
for (int i = 1; i < 5; i++) {
// write another 9 commits to trigger compaction twice. Since default clean version to retain is 2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to change the clean strategy then?

.key("hoodie.log.compaction.enable")
.defaultValue("false")
.sinceVersion("0.14")
.withDocumentation("By enabling log compaction through this config, log compaction will also get enabled for the metadata table.");
Copy link
Contributor

@danny0405 danny0405 Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems only MDT uses the log compaction. If that is true, kind of think this belongs to a MDT config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log compaction can also be done on a main table, if it of MOR table type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think enable log compaction is still required so created another config in HoodieMetadataConfig class.

suryaprasanna and others added 10 commits June 9, 2023 15:46
…various bugfixes to metadata table

Following changes are also included as part of this commit:

1. Change cleaner policy to KEEP_LATEST_FILE_VERSIONS for metadata table
2. Added logs statements
3. Fix rollback of inflight deltacommits on metadata table
4. Add log statements to LogCompaction planner
5. Integrate logcompaction table service on metadata table
6. Include checks to block Logcompaction in presence of compaction with greater timestamp
7. Use instant range option for major and minor compaction on metadata table
…onfig/HoodieCompactionConfig.java

Co-authored-by: Sagar Sumit <[email protected]>
…able/action/compact/CompactHelpers.java

Co-authored-by: Sagar Sumit <[email protected]>
Copy link
Member

@codope codope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can land once the CI is green.

@apache apache deleted a comment from hudi-bot Jun 9, 2023
@codope
Copy link
Member

codope commented Jun 9, 2023

@hudi-bot
Copy link
Collaborator

hudi-bot commented Jun 9, 2023

CI report:

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

TaskContextSupplier taskContextSupplier,
Option<BaseKeyGenerator> keyGeneratorOpt) {
LOG.info("Create update handle for fileId {} and partition path {} at commit {}", fileId, partitionPath, instantTime);
if (table.requireSortedRecords()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove this log, it's verbose.

TaskContextSupplier taskContextSupplier,
Option<BaseKeyGenerator> keyGeneratorOpt) {
LOG.info("Get updateHandle for fileId {} and partitionPath {} at commit {}", fileId, partitionPath, instantTime);
if (table.requireSortedRecords()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove this log, it's verbose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will change it to debug mode in subsequent patch.

@codope codope merged commit 195ae3a into apache:master Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:critical Production degraded; pipelines stalled release-0.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants