-
Notifications
You must be signed in to change notification settings - Fork 44
feat: implement record deletion #97
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
70bbddb
to
7b5d7eb
Compare
RecordAndOffset { | ||
record: record_2, | ||
offset: offset_2 | ||
}, |
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.
BTW: this is technically a bug since we request data >= offset_3
. The bug existed since forever and the next PR will fix that bug.
7b5d7eb
to
3fa246b
Compare
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.
Looks good to me, and tests cases I wouldn't have even thought to test 😆
Some minor naming nits is all
} | ||
|
||
#[derive(Debug)] | ||
pub struct DeletePartitionResponse { |
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.
Same as the requests I think these should be named to make clear that they correspond to the DeleteRecords API
Ok(()) => {} | ||
// Redpanda does not support deletions (https://github.com/redpanda-data/redpanda/issues/1016), but we also | ||
// don't wanna skip it unconditionally | ||
Err(ClientError::Request(RequestError::NoVersionMatch { .. })) |
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.
👌
ClientError::ServerError(ProtocolError::OffsetOutOfRange, _) | ||
); | ||
|
||
// fetching untouched records still works, however the middle record batch is NOT half-deleted and still contains record_2 |
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.
Aah yes, good-ole Kafka-style UX 😆
err, | ||
ClientError::ServerError(ProtocolError::OffsetOutOfRange, _) | ||
); | ||
let err = partition_client |
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 is wild, so if you request offset_2 it will error, but if you then fetch data it will magically return offset 2 🤯
3fa246b
to
304eedd
Compare
We don't need record deletion in production, but having this operation available helps us to understand how Kafka behaves when data is truncated due to retention policies.