Skip to content

[ENH] If the dirty log fails with LogContentionDurable, do not fail the operation. #4953

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

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented Jun 26, 2025

Description of changes

Both roll_dirty_log and mark_dirty append to the dirty log. At high gc
rates, this can fail, and the operation will fail. We can simply return
Ok(()) for any case where the log is durable.

Test plan

CI

Documentation Changes

N/A

Copy link
Contributor

propel-code-bot bot commented Jun 26, 2025

Handle LogContentionDurable Errors Gracefully in Dirty Log Operations

This PR modifies both the log-service and the wal3 implementation so that operations which would fail due to a LogContentionDurable error when appending to the dirty log now succeed instead, treating this error as a non-fatal, recoverable state. This improves reliability during high garbage collection rates by preventing spurious failures when the log is already in a durable state.

Key Changes:
• In wal3::writer, wrap mark_dirty async to return Ok(()) on Error::LogContentionDurable instead of failing.
• In log-service, update save_dirty_log (reached via roll_dirty_log) to accept Ok or LogContentionDurable as non-errors when appending many dirty markers.
• Remove Display-level error annotation from tracing macro in wal3::manifest for consistency (minor).

Affected Areas:
• rust/wal3/src/writer.rs
• rust/log-service/src/lib.rs
• rust/wal3/src/manifest.rs (tracing instrumentation)

This summary was automatically generated by @propel-code-bot

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

…he operation.

Both roll_dirty_log and mark_dirty append to the dirty log.  At high gc
rates, this can fail, and the operation will fail.  We can simply return
Ok(()) for any case where the log is durable.
@rescrv rescrv force-pushed the rescrv/no-log-contention-durable-error branch from 6a7c800 to 69c7963 Compare June 26, 2025 16:17
@rescrv rescrv merged commit 591856a into main Jun 26, 2025
57 checks passed
rescrv added a commit that referenced this pull request Jun 26, 2025
…he operation. (#4953)

## Description of changes

Both roll_dirty_log and mark_dirty append to the dirty log.  At high gc
rates, this can fail, and the operation will fail.  We can simply return
Ok(()) for any case where the log is durable.

## Test plan

CI

## Documentation Changes

N/A
rescrv added a commit that referenced this pull request Jun 27, 2025
## Description of changes

Included changes

- **[ENH] Purge dirty log in background at the end of scheduled
compaction (#4915)**
- **[ENH] Move Log GC to operator (#4919)**
- **[BUG]  Do not leak tokio tasks in the log service. (#4936)**
- **[BUG] Log GC offset should be one above minimum compaction offset
(#4938)**
- **[ENH] Make roll dirty log always converge to coalesce everything.
(#4927)**
- **[BUG] Coalesce when multiple collections return the same info to
compact (#4946)**
- **[BUG]  Enrich from the manifest if a cursor doesn't exist. (#4947)**
- **[ENH] If the dirty log fails with LogContentionDurable, do not fail
the operation. (#4953)**
- **[ENH]  Warn, not error, if dirty log has no cursor. (#4952)**
- **[ENH]  Cancellation safety for append_batch. (#4959)**

## Test plan

CI

## Documentation Changes

N/A

---------

Co-authored-by: Macronova <60079945+Sicheng-Pan@users.noreply.github.com>
@rescrv rescrv deleted the rescrv/no-log-contention-durable-error branch August 1, 2025 18:18
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
…he operation. (chroma-core#4953)

## Description of changes

Both roll_dirty_log and mark_dirty append to the dirty log.  At high gc
rates, this can fail, and the operation will fail.  We can simply return
Ok(()) for any case where the log is durable.

## Test plan

CI

## Documentation Changes

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants