You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "dajneem23 (via GitHub)" <gi...@apache.org> on 2026/02/24 08:12:09 UTC
[PR] feat(server): delete segments command for http [iggy]
dajneem23 opened a new pull request, #2804:
URL: https://github.com/apache/iggy/pull/2804
## Which issue does this PR close?
Closes #2722
## Rationale
`delete_segments` already exists in binary/CLI/MCP and the HTTP SDK client already sends it, but the server HTTP API had no matching handler, so requests returned `404`. This left HTTP behavior inconsistent with other transports.
## What changed?
- Added server-side HTTP support for `delete_segments` in [`core/server/src/http/segments.rs`](./core/server/src/http/segments.rs), following the same flow as partitions: parse path/query, validate, run permission check, -call `delete_segments_base`, and apply `DeleteSegments` state command.
- Registered/kept the HTTP route wiring in the server HTTP router path for `/streams/{stream_id}/topics/{topic_id}/partitions/{partition_id}` with `DELETE`.
- Enhanced [`core/integration/tests/server/scenarios/system_scenario.rs`](./core/integration/tests/server/scenarios/system_scenario.rs) to call `delete_segments` at the end and verify partition `segments_count` before/after.
- Updated [`web/docs/server-api.http`](./web/docs/server-api.http) with:
```
`DELETE {{url}}/streams/1/topics/1/partitions/1?segments_count=3`
`Authorization: Bearer {{access_token}}`
(Path params: `stream_id`, `topic_id`, `partition_id`; query param: `segments_count`.)
```
## Local Execution
- Passed: `cargo fmt --all`, `cargo check -p server`, `cargo test -p integration --test mod --no-run`
- Pre-commit hooks ran: ran
## AI Usage
1. Tool: ChatGPT (Codex)
2. Scope: PR text drafting and test generation/updates system_scenario.rs
3. Verification: Local formatting/check/test commands listed above
4. Yes, every line can be explained if asked
--
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] feat(server): delete segments command for http [iggy]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #2804:
URL: https://github.com/apache/iggy/pull/2804#issuecomment-3949971085
## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/2804?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 64.10%. Comparing base ([`d897efb`](https://app.codecov.io/gh/apache/iggy/commit/d897efbab6f847c517a546f2ed1397ffef3860cc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4cc2f9f`](https://app.codecov.io/gh/apache/iggy/commit/4cc2f9f944b4b44fd6433ae3ce54bc432f1e4a42?dropdown=coverage&el=desc&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 #2804 +/- ##
============================================
- Coverage 68.41% 64.10% -4.31%
Complexity 656 656
============================================
Files 852 852
Lines 68182 68180 -2
Branches 59643 59651 +8
============================================
- Hits 46648 43709 -2939
- Misses 19201 22342 +3141
+ Partials 2333 2129 -204
```
| [Flag](https://app.codecov.io/gh/apache/iggy/pull/2804/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [csharp](https://app.codecov.io/gh/apache/iggy/pull/2804/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `12.62% <ø> (-54.63%)` | :arrow_down: |
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/2804?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/http/http\_server.rs](https://app.codecov.io/gh/apache/iggy/pull/2804?src=pr&el=tree&filepath=core%2Fserver%2Fsrc%2Fhttp%2Fhttp_server.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXIvc3JjL2h0dHAvaHR0cF9zZXJ2ZXIucnM=) | `48.08% <ø> (ø)` | |
| [core/server/src/shard/system/segments.rs](https://app.codecov.io/gh/apache/iggy/pull/2804?src=pr&el=tree&filepath=core%2Fserver%2Fsrc%2Fshard%2Fsystem%2Fsegments.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXIvc3JjL3NoYXJkL3N5c3RlbS9zZWdtZW50cy5ycw==) | `89.54% <ø> (-0.06%)` | :arrow_down: |
... and [82 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/2804/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] feat(server): delete segments command for http [iggy]
Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #2804:
URL: https://github.com/apache/iggy/pull/2804
--
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