chengxilo opened a new pull request, #3608: URL: https://github.com/apache/iggy/pull/3608
## Which issue does this PR address? Relates to #2148 ## Rationale <!-- Why is this change needed? If the issue explains it well, a one-liner is fine. --> Go SDK doesn't have the purge topic/ purge stream API, so this PR implement them. To test it, I added an new BDD test scenario, and implemented both Go and Rust BDD tests. ## What changed? <!-- 2-4 sentences. Problem first (before), then solution (after). GOOD: "Messages were unavailable when background message_saver committed the journal and started async disk I/O before completion. Polling during this window found neither journal nor disk data. The fix freezes journal batches in the in-flight buffer before async persist." GOOD: "When many small messages accumulate in the journal, the flush passes thousands of IO vectors to writev(), exceeding IOV_MAX (1024 on Linux)." BAD: - Walls of text - "This PR adds..." (we can see the diff) --> The Go SDK was missing PurgeStream and PurgeTopic methods. Added them along with a shared BDD scenario (stream_topic_purge.feature) and implementations in both Go and Rust. While testing, discovered that purge_all_segments only cleared on-disk segments but left stale messages in the journal and in-flight tiers. Polling after purge would return messages that should have been deleted. Fixed by calling `journal.reset()` and `clear_in_flight()` during partition re-initialization. I am not famliar with Rust server code so during the code review this part worth more attention ## Local Execution - Passed - Pre-commit hooks ran <!-- You must run your code locally before submitting. "Relying on CI" is not acceptable - PRs from authors who haven't run the code will be closed. Did you have `prek` installed? It runs automatically on commit and covers all project languages. See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md). --> ## AI Usage <!-- If AI tools were used, please answer: 1. Which tools? (e.g., GitHub Copilot, Claude, ChatGPT) 2. Scope of usage? (e.g., autocomplete, generated functions, entire implementation) 3. How did you verify the generated code works correctly? 4. Can you explain every line of the code if asked? If no AI tools were used, write "None" or delete this section. --> 1. DeepSeek pro v4, Claude Opus 4.6 2. DeepSeek pro v4 for BDD test implementation, Claude Opus 4.6 for server bug fixing. 3. I reviewed them with my best effert, the bdd scripts are executed and actually works, and they found that there is a bug in the server so I believe they works. 4. I hope so. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
