Skip to content

Conversation

crepererum
Copy link
Collaborator

@crepererum crepererum commented Feb 9, 2022

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.

@crepererum crepererum force-pushed the crepererum/deletes branch 2 times, most recently from 70bbddb to 7b5d7eb Compare February 9, 2022 15:09
@crepererum crepererum marked this pull request as ready for review February 9, 2022 15:09
@crepererum crepererum requested a review from tustvold February 9, 2022 15:09
Comment on lines +440 to +443
RecordAndOffset {
record: record_2,
offset: offset_2
},
Copy link
Collaborator Author

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.

Copy link
Contributor

@tustvold tustvold left a 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 {
Copy link
Contributor

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 { .. }))
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 🤯

@crepererum crepererum added the automerge Instruct kodiak to merge the PR label Feb 14, 2022
@kodiakhq kodiakhq bot merged commit 24aac8b into main Feb 14, 2022
@crepererum crepererum deleted the crepererum/deletes branch February 16, 2022 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Instruct kodiak to merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants