Skip to content

region: Call DeserializeCellBlocks even if no cells#336

Merged
aaronbee merged 1 commit intomasterfrom
emptyresult
Mar 26, 2026
Merged

region: Call DeserializeCellBlocks even if no cells#336
aaronbee merged 1 commit intomasterfrom
emptyresult

Conversation

@aaronbee
Copy link
Copy Markdown
Collaborator

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.

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.
@aaronbee aaronbee requested a review from ciacono March 24, 2026 18:45
@aaronbee aaronbee merged commit 9367c0a into master Mar 26, 2026
2 checks passed
@aaronbee aaronbee deleted the emptyresult branch March 26, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants