automq
automq copied to clipboard
[Good First Issue] Write Unit Tests for `WALConfirmOffsetCalculator`
Problem Description
The com.automq.stream.s3.S3Storage.WALConfirmOffsetCalculator class currently lacks comprehensive unit tests.
Required Changes
- Read and understand the original implementation:
S3Storagesendsappendrequests to the WAL, but the WAL does not guarantee the order of persistence completion (earlier requests may complete later).- When
S3Storageconfirms that all requests prior to a specific offset have been persisted and uploaded to S3, it calls the WAL'strimmethod to discard data before that offset. WALConfirmOffsetCalculatorimplements a near-optimal algorithm to determine the current confirm offset. It prioritizes low overhead (O(n)) over perfect accuracy or immediacy.
- Focus on validating the
calculatemethod (consider modifying method visibility for testability if needed).
/assign
/assign
/assign
/assgin
/assgin
pick up