-
Notifications
You must be signed in to change notification settings - Fork 579
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
Fixed assertion triggered when fetching from empty topics with transactions enabled #3159
Fixed assertion triggered when fetching from empty topics with transactions enabled #3159
Conversation
@@ -134,7 +134,9 @@ static ss::future<read_result> read_from_partition( | |||
auto lso = part.last_stable_offset(); | |||
auto start_o = part.start_offset(); | |||
// if we have no data read, return fast | |||
if (hw < config.start_offset || config.skip_read) { | |||
if ( | |||
hw < config.start_offset || config.skip_read |
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.
test for this?
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.
added ducktape test, took me some time to reproduce this
It may happen that last stable offset is equal to log start offset. In this case when consumer requests a read with a `read_committed` isolation level it should receive no batches since the log is empty. Otherwise when records are present in the log we need to read up to LSO-1 since batch pointed by LSO is the first offset for which transactions may not be resolved. Added explicit check to partition read code path to return fast when requested max offset is smaller than start offset indicating no data should be returned. Signed-off-by: Michal Maslanka <michal@vectorized.io>
…verity When using trace log severity we should log more info to facilitate Fetch request debugging. The same level of logging is used in produce request, fetch handler is now consistent. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Signed-off-by: Michal Maslanka <michal@vectorized.io>
Signed-off-by: Michal Maslanka <michal@vectorized.io>
Signed-off-by: Michal Maslanka <michal@vectorized.io>
21b286d
to
45ae3cb
Compare
|
||
def consume(n=1): | ||
|
||
out = rpk.consume(self.topic, group=consumer_group, n=n) |
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.
rpk now supports -f '%o'\n
if you want to have offsets printed with newlines.
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.
Can you add an explanation of how this is related to transactions? transactions
is in the PR title, but there doesn't seem to be any connection with transactions in the code nor the commit messages.
EDIT: just realized I missed since batch pointed by LSO is the first offset for which transactions may not be resolved.
All good!
Cover letter
It may happen that last stable offset is equal to log start offset.
In this case when consumer requests a read with a
read_committed
isolation level it should receive no batches since the log is empty.
Otherwise when records are present in the log we need to read up to
LSO-1
since batch pointed byLSO
is the first offset for whichtransactions may not be resolved.
Added explicit check to partition read code path to return fast
when requested max offset is smaller than start offset indicating no
data should be returned.