You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "gomnitrix (via GitHub)" <gi...@apache.org> on 2026/02/22 21:55:33 UTC
[PR] fix(server): prevent storing consumer offsets beyond max partition range [iggy]
gomnitrix opened a new pull request, #2794:
URL: https://github.com/apache/iggy/pull/2794
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #2730
## Rationale
<!--
Why is this change needed? If the issue explains it well, a one-liner is fine.
-->
Consumers shouldn't be able to store offsets for messages that haven't been written to the partition yet.
## What changed?
Before this, [store_consumer_offset](https://github.com/apache/iggy/blob/aff29a544372fe5487598339830dafecb39aa14e/core/server/src/shard/system/consumer_offsets.rs#L35) would accept basically any offset you threw at it. Now it validates the requested offset against the partition's `current_offset` and throws an `InvalidOffset` error if it's out of bounds.
It also completely blocks storing any offset on empty partitions.
Added integration tests to cover these boundaries for both single consumers and groups.
## 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
1. Which tools?
Google Antigravity with Gemini 3.1 pro
2. Scope of usage?
Autocomplete and code review
3. How did you verify the generated code works correctly?
Wrote and ran the new `invalid_consumer_offset` integration tests locally to verify the exact boundary conditions.
4. Can you explain every line of the code if asked?
Yes.
--
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: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(server): prevent storing consumer offsets beyond max partition range [iggy]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #2794:
URL: https://github.com/apache/iggy/pull/2794#issuecomment-3941800136
## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/2794?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `95.65217%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 68.54%. Comparing base ([`aff29a5`](https://app.codecov.io/gh/apache/iggy/commit/aff29a544372fe5487598339830dafecb39aa14e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`c2abb4b`](https://app.codecov.io/gh/apache/iggy/commit/c2abb4bd5aebc19ea5359a2f2e0194c28332d188?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/2794?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [core/server/src/shard/system/utils.rs](https://app.codecov.io/gh/apache/iggy/pull/2794?src=pr&el=tree&filepath=core%2Fserver%2Fsrc%2Fshard%2Fsystem%2Futils.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXIvc3JjL3NoYXJkL3N5c3RlbS91dGlscy5ycw==) | 95.45% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/iggy/pull/2794?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #2794 +/- ##
============================================
+ Coverage 68.52% 68.54% +0.02%
Complexity 656 656
============================================
Files 743 743
Lines 62808 62831 +23
Branches 59221 59244 +23
============================================
+ Hits 43039 43068 +29
+ Misses 17656 17652 -4
+ Partials 2113 2111 -2
```
| [Flag](https://app.codecov.io/gh/apache/iggy/pull/2794/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [rust](https://app.codecov.io/gh/apache/iggy/pull/2794/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.61% <95.65%> (+0.02%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/2794?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [core/server/src/shard/system/consumer\_offsets.rs](https://app.codecov.io/gh/apache/iggy/pull/2794?src=pr&el=tree&filepath=core%2Fserver%2Fsrc%2Fshard%2Fsystem%2Fconsumer_offsets.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXIvc3JjL3NoYXJkL3N5c3RlbS9jb25zdW1lcl9vZmZzZXRzLnJz) | `83.20% <100.00%> (+0.04%)` | :arrow_up: |
| [core/server/src/shard/system/utils.rs](https://app.codecov.io/gh/apache/iggy/pull/2794?src=pr&el=tree&filepath=core%2Fserver%2Fsrc%2Fshard%2Fsystem%2Futils.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXIvc3JjL3NoYXJkL3N5c3RlbS91dGlscy5ycw==) | `81.42% <95.45%> (+1.91%)` | :arrow_up: |
... and [17 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/2794/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(server): prevent storing consumer offsets beyond max partition range [iggy]
Posted by "gomnitrix (via GitHub)" <gi...@apache.org>.
gomnitrix commented on PR #2794:
URL: https://github.com/apache/iggy/pull/2794#issuecomment-3944651881
> looks good, but after this change, the partition_exists check in store_consumer_offset (consumer_offsets.rs:54-63) is redundant - validate_partition_offset already returns PartitionNotFound when get_partition_stats_by_ids returns None.could be removed to avoid the extra metadata read.
@hubcio Thanks for pointing that out! I just removed the redundant block to save the extra read and pushed the update.
--
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: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(server): prevent storing consumer offsets beyond max partition range [iggy]
Posted by "mmodzelewski (via GitHub)" <gi...@apache.org>.
mmodzelewski merged PR #2794:
URL: https://github.com/apache/iggy/pull/2794
--
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: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org