Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

reduce append noise#187

Merged
shikhar merged 1 commit intomainfrom
noisy-appends
Jan 16, 2026
Merged

reduce append noise#187
shikhar merged 1 commit intomainfrom
noisy-appends

Conversation

@shikhar
Copy link
Member

@shikhar shikhar commented Jan 16, 2026

now there is an ack for every record

@shikhar shikhar requested a review from a team as a code owner January 16, 2026 18:49
@greptile-apps
Copy link

greptile-apps bot commented Jan 16, 2026

Greptile Summary

Adds deduplication logic to reduce console noise when multiple append acknowledgments share the same batch.end.seq_num. The change tracks the last printed batch end sequence number and skips printing if it matches the current ack.

  • Prevents duplicate prints for consecutive acks with identical batch end sequence numbers
  • Logic has edge case: only checks last printed value, not full history - may re-print if acks arrive out of order

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • Simple deduplication logic with clear intent, but has edge case where out-of-order acks could bypass deduplication
  • No files require special attention

Important Files Changed

Filename Overview
src/main.rs Added deduplication logic to reduce repeated append acknowledgment messages for the same batch

Sequence Diagram

sequenceDiagram
    participant Input as Record Stream
    participant Append as ops::append
    participant Producer as S2 Producer
    participant Main as main.rs Loop
    participant Console as stderr Output

    Input->>Append: Records
    Append->>Producer: Submit records with permits
    Producer-->>Append: IndexedAppendAck(s)
    Append-->>Main: Ack stream
    
    loop Process acks
        Main->>Main: Receive ack
        Main->>Main: Check if batch.end.seq_num != last_printed
        alt New batch end
            Main->>Main: Update last_printed_batch_end
            Main->>Console: Print ✓ [APPENDED] message
        else Duplicate batch end
            Main->>Main: Skip printing (deduplication)
        end
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

.green()
.bold()
);
if last_printed_batch_end.is_none_or(|end| end != ack.batch.end.seq_num) {
Copy link

Choose a reason for hiding this comment

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

logic: only checks if the current batch end differs from the last printed one, not if it's been printed before - if acks arrive out of order (e.g. 100, 200, 100), the second occurrence of 100 would print again

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main.rs
Line: 356:356

Comment:
**logic:** only checks if the current batch end differs from the **last** printed one, not if it's been printed before - if acks arrive out of order (e.g. 100, 200, 100), the second occurrence of 100 would print again

How can I resolve this? If you propose a fix, please make it concise.

@shikhar shikhar merged commit d902877 into main Jan 16, 2026
4 checks passed
@shikhar shikhar deleted the noisy-appends branch January 16, 2026 18:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant