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

Leverage row tracking to reduce memory overhead of log replay #702

Open
scovich opened this issue Feb 19, 2025 · 0 comments
Open

Leverage row tracking to reduce memory overhead of log replay #702

scovich opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@scovich
Copy link
Collaborator

scovich commented Feb 19, 2025

Please describe why this is necessary.

Today, log replay remembers every file it has ever encountered until log replay is complete.

However, if row tracking is enabled, the Delta spec mandates that:

  • Writers must set the defaultRowCommitVersion field in new add actions to the version number of the log entry containing the add action.
  • Writers must set the defaultRowCommitVersion field in recommitted and checkpointed add actions and remove actions to the defaultRowCommitVersion of the last committed add action with the same path.

The first condition is a base case, and the second condition is a recursive case, and together they guarantee that all file actions correctly identify the commit that first added whatever physical file they reference.

Describe the functionality you are proposing.

We should update log replay to leverage row tracking, when available.

For example, if log replay is processing commit 100, and we encounter add.defaultRowCommitVersion=100, then we know we'll never see that file again and can dedup by calling seen.remove(&key) instead of seen.contains(&key).

Doing so can reduce memory overhead significantly when replaying a log with lots of high-churn commits, because the add+remove pairs that churned can be dropped from the seen set as soon as we see the original add that created the file.

The only gotcha is, I don't think we support row tracking yet?

Additional context

No response

@scovich scovich added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant