-
Notifications
You must be signed in to change notification settings - Fork 47
DOC-1720 Customer-Incident-Delete Records #1388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for redpanda-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
modules/reference/pages/rpk/rpk-topic/rpk-topic-trim-prefix.adoc (1)
7-9
: Fix typo and tighten wording.
- “less then” → “less than”
- Consider simplifying phrasing for readability.
Apply this diff:
-sets the LogStartOffset for partitions to the requested offset. All segments -whose base offset is less then the requested offset are deleted, and any records -within the segment before the requested offset can no longer be read. +sets the LogStartOffset for partitions to the requested offset. All segments +whose base offset is less than the requested offset are deleted, and any records +within a remaining segment before the requested offset can no longer be read.
🧹 Nitpick comments (3)
modules/reference/pages/rpk/rpk-topic/rpk-topic-trim-prefix.adoc (2)
11-13
: Avoid “low watermark” (can be confused with Kafka LSO).Use “start offset (LogStartOffset)” consistently to prevent confusion with last stable offset (LSO).
Apply this diff:
-The `--offset/-o` flag allows you to indicate which index you want to set the -partition's low watermark (start offset) to. It can be a single integer value +The `--offset/-o` flag lets you set the partition's start offset (LogStartOffset). +It can be a single integer value denoting the offset, or it can be a timestamp if you prefix the offset with an '@'. You can select which partition you want to trim the offset from with the `--partitions/-p` flag.
37-43
: Fix grammar and clarify timestamp formats-* Trim records in all partitions of topic foo previous to an specific timestamp: +* Trim records in all partitions of topic 'foo' prior to a specific timestamp:Add that
-o "@<timestamp>"
supports:
- 13-digit Unix milliseconds (e.g. 1622505600000)
- 9-digit Unix seconds (e.g. 1622505600)
- date-only (YYYY-MM-DD in UTC)
- RFC3339 datetimes (YYYY-MM-DDTHH:MM:SSZ, optional fractional seconds)
- relative durations (e.g. -48h, 1h, 3ms)
See rpk topic trim-prefix and rpk topic consume docs for details.
modules/shared/partials/warning-delete-records.adoc (1)
3-3
: Clarify trim-prefix timestamp boundary and sourceIn modules/shared/partials/warning-delete-records.adoc line 3, note that
rpk topic trim-prefix @<timestamp>
resolves to the earliest offset whose record timestamp is ≥ the specified timestamp, and that the timestamp used comes from the topic’smessage.timestamp.type
(CreateTime = producer-supplied, LogAppendTime = broker append time).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
modules/develop/partials/delete-topic-records.adoc
(1 hunks)modules/reference/pages/rpk/rpk-topic/rpk-topic-trim-prefix.adoc
(2 hunks)modules/shared/partials/warning-delete-records.adoc
(1 hunks)
🔇 Additional comments (3)
modules/develop/partials/delete-topic-records.adoc (1)
14-14
: Good call including the shared warning here.This centralizes the timestamp caveats for all delete flows.
modules/reference/pages/rpk/rpk-topic/rpk-topic-trim-prefix.adoc (1)
26-26
: Good inclusion of the shared warning partial.Ensures users see the truncation risk right where they execute the command.
modules/shared/partials/warning-delete-records.adoc (1)
5-8
: %d supports Go-style timestamps Confirmed thatrpk topic consume --format '%o %d{go[2006-01-02T15:04:05Z07:00]} %k %v'
is valid.
@@ -0,0 +1,9 @@ | |||
[WARNING] | |||
==== | |||
When you delete records from a topic with a timestamp, Redpanda advances the partition start offset to the first record whose timestamp is after the threshold. If record timestamps are not in order with respect to offsets, this may truncate an entire partition. Before using a timestamp, verify that timestamps increase in the same order as offsets in the topic to avoid unintended data loss. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may truncate an entire partition
Is like the worst case scenario, maybe want something like
If record timestamps are not in order with respect to offsets, this may result in unintended deletion of data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules/reference/pages/rpk/rpk-topic/rpk-topic-trim-prefix.adoc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Co-authored-by: Joyce Fee <[email protected]>
Co-authored-by: Joyce Fee <[email protected]>
Description
This pull request improves documentation related to deleting records from a topic in Redpanda. The main focus is on clarifying the risks of using timestamps with the
rpk topic trim-prefix
command and ensuring users are aware of potential unintended data loss.warning-delete-records.adoc
) that explains the risks of using timestamps withrpk topic trim-prefix
, including potential for truncating an entire partition if timestamps are unordered.delete-topic-records.adoc
) and therpk topic trim-prefix
reference documentation to alert users in both contexts. [1] [2]Resolves https://redpandadata.atlassian.net/browse/DOC-1720
Review deadline:
Page previews
rpk topic trim prefix (SM, Cloud)
Delete records from a topic (SM, Cloud)
Checks