[
https://issues.apache.org/jira/browse/CASSANDRA-17049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17442755#comment-17442755
]
Alex Petrov commented on CASSANDRA-17049:
-----------------------------------------
+1. The only comments I have is that there's no test (but since it's
straightforward yet rare and is difficult to reproduce, I'd say it's fine), and
that
[here|https://github.com/iamaleksey/cassandra/commit/05f379b812a9967b192347a341ae9270a35c27b4#diff-03e0ee2c01f2ca4d3b15d3a1fc4917d8737861c15d8c83cb73b352fe9da22d1aR410]
we may additionally check for emptiness of the {NodesToHint} (but since it
would work just fine even without it, please feel free to omit).
> Fix rare NPE caused by batchlog replay / node decomission races
> ---------------------------------------------------------------
>
> Key: CASSANDRA-17049
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17049
> Project: Cassandra
> Issue Type: Bug
> Components: Consistency/Batch Log, Consistency/Hints
> Reporter: Aleksey Yeschenko
> Assignee: Aleksey Yeschenko
> Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x, 4.x
>
>
> Batchlog replay process collects addresses of the hosts that have been hinted
> to, so it can flush hints for them to disk before confirming deletion of the
> replayed batches. If a node has been decommissioned during replay, however,
> when the time comes to flush the hints at the very end of replay,
> {{StorageService.getHostIdForEndpoint()}} will return {{null}} for its
> address, which will, down the line, cause {{HintsCatalog::get()}} to be
> invoked with a {{null}} host id argument, causing an NPE.
> The simple fix is to check returned host ids for addresses for nulls, and
> collect hinted host ids instead of hinted addresses.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]