automq icon indicating copy to clipboard operation
automq copied to clipboard

[Good First Issue] Write Unit Tests for `WALConfirmOffsetCalculator`

Open Chillax-0v0 opened this issue 9 months ago • 7 comments

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 avatar Mar 18 '25 08:03 Chillax-0v0

/assign

saveole avatar Mar 27 '25 08:03 saveole

/assign

Yao-Y-B avatar Apr 09 '25 02:04 Yao-Y-B

/assign

godsboy404 avatar Apr 14 '25 02:04 godsboy404

/assgin

ZefanHu avatar Apr 20 '25 02:04 ZefanHu

/assgin

zhongshanshan avatar Apr 24 '25 06:04 zhongshanshan

pick up

sakshamVerma08 avatar May 04 '25 18:05 sakshamVerma08