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

[Good First Issue] Write Unit Tests for WALConfirmOffsetCalculator #2367

Open
Chillax-0v0 opened this issue Mar 18, 2025 · 2 comments
Open
Assignees
Labels
good first issue Good for newcomers

Comments

@Chillax-0v0
Copy link
Contributor

Chillax-0v0 commented Mar 18, 2025

Problem Description

The com.automq.stream.s3.S3Storage.WALConfirmOffsetCalculator class currently lacks comprehensive unit tests.

Required Changes

  1. Read and understand the original implementation:
    1. S3Storage sends append requests to the WAL, but the WAL does not guarantee the order of persistence completion (earlier requests may complete later).
    2. When S3Storage confirms that all requests prior to a specific offset have been persisted and uploaded to S3, it calls the WAL's trim method to discard data before that offset.
    3. WALConfirmOffsetCalculator implements a near-optimal algorithm to determine the current confirm offset. It prioritizes low overhead (O(n)) over perfect accuracy or immediacy.
  2. Focus on validating the calculate method (consider modifying method visibility for testability if needed).
@Chillax-0v0 Chillax-0v0 added the good first issue Good for newcomers label Mar 18, 2025
@saveole
Copy link

saveole commented Mar 27, 2025

/assign

@Yao-Y-B
Copy link

Yao-Y-B commented Apr 9, 2025

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants