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

[ENH] wal3 is the write-ahead logging lightweight library #3028

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented Oct 29, 2024

Documented in rust/wal3/README.md.

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)

rust/wal3/README.md Outdated Show resolved Hide resolved
rust/wal3/README.md Outdated Show resolved Hide resolved
Comment on lines +255 to +259
- A reader writing a _new_ cursor, or a cursor that goes back in time must complete the operation in
less than the garbage collection interval and then check for a concurrent garbage collection
before it considers the operation complete. If the reader somehow hangs between loading a log
offset and writing the cursor for more than the garbage collection interval, the cursor will
reference garbage collected data. The reader will fail.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: reader abstraction (and cursor) has not been introduced so far

use crate::{Error, LogPosition};

////////////////////////////////////////////// Cursor //////////////////////////////////////////////

Copy link
Contributor

Choose a reason for hiding this comment

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

note for reviewer: the read path is WIP

// allows. If we hit throttle errors at this throughput we have a case for support.
throughput: 2_000,
// How much headroom we have for retries.
headroom: 1_500,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if throughput + headroom = <s3_throughput>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's how I picked these constants.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case the comments seems suspicious: if a throughput of 2000 is 5/7 of max throughput, doesn't this imply the head room is 800?

.map(|f| f.seq_no)
.max()
.unwrap_or(ShardSeqNo(0));
max_seq_no < max_seq_no + 1 && max_seq_no + 1 == *seq_no && *start < *limit
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask what is max_seq_no < max_seq_no + 1 checking for here? Is this equivalent to max_seq_no < u64::Max?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That check would do it, too, but precludes allowing u64::MAX as a value. I'm fine to throw that value away. Would you find the check more readable that way?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine both way. I'm wondering if it is ever possible to violate this check?

Copy link
Contributor

@Sicheng-Pan Sicheng-Pan left a comment

Choose a reason for hiding this comment

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

Waiting @HammadB for further review

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