The hostid nver changes so there no reason to
use nodetool every time to get it.
Tests that want to exercise nodetool for that can do that by explicitly running nodetool, or passing force_refresh=True if they insist :)
Otherwise, cache the result in self.node_hostid
to be reused next time hostid() is called.
This is particularly needed for node operations
scenarios when an operation like replacenode
runs after removenode that happened to stop the
to-be-replaced node.
Since scylladb/scylla-dtest@97a341adc4adeb1a27e00db1bb4614b0d1f53618 the replace node operation operates on the node hostid and that cannot be retrieved if the node is already dead without this change.
The hostid nver changes so there no reason to use nodetool every time to get it.
Tests that want to exercise nodetool for that can do that by explicitly running nodetool, or passing force_refresh=True if they insist :)
Otherwise, cache the result in self.node_hostid to be reused next time hostid() is called.
This is particularly needed for node operations scenarios when an operation like replacenode runs after removenode that happened to stop the to-be-replaced node.
Since scylladb/scylla-dtest@97a341adc4adeb1a27e00db1bb4614b0d1f53618 the replace node operation operates on the node hostid and that cannot be retrieved if the node is already dead without this change.
Signed-off-by: Benny Halevy bhalevy@scylladb.com