region: Call DeserializeCellBlocks even if no cells#336
Merged
Conversation
When receiving a result from HBase always call DeserializeCellBlocks even if there are none. In ScanV2 the DeserializeCellBlocks needs to be called to craft the ScanResponseV2 that is returned to the client. In the case that there are no cellblocks, ie. the response is empty, we still want the response to be created. It can contain useful information, such as the fact that the end of the region was reached. To ensure there is no fall out from calling DeserializeCellBlocks with an empty slice new tests were added for this. multi.DeserializeCellBlocks was made to return early if there are no cellblocks to avoid doing useless work. Multi's are used in gohbase to send large batches of mutate requests, which have no cellblocks in response so it seemed worthwhile to make this optimization. This required updating some error case tests that were not passing in any cellblocks previously. The early return was not needed for the other implementations because they are unlikely to be called with empty cellblocks. eg. A Get and Scan always have cellblocks. A mutate typically doesn't, but those are wrapped in multis which are already skipping the call.
ciacono
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When receiving a result from HBase always call DeserializeCellBlocks even if there are none.
In ScanV2 the DeserializeCellBlocks needs to be called to craft the ScanResponseV2 that is returned to the client. In the case that there are no cellblocks, ie. the response is empty, we still want the response to be created. It can contain useful information, such as the fact that the end of the region was reached.
To ensure there is no fall out from calling DeserializeCellBlocks with an empty slice new tests were added for this.
multi.DeserializeCellBlocks was made to return early if there are no cellblocks to avoid doing useless work. Multi's are used in gohbase to send large batches of mutate requests, which have no cellblocks in response so it seemed worthwhile to make this optimization. This required updating some error case tests that were not passing in any cellblocks previously.
The early return was not needed for the other implementations because they are unlikely to be called with empty cellblocks. eg. A Get and Scan always have cellblocks. A mutate typically doesn't, but those are wrapped in multis which are already skipping the call.