ammend clarifying comment for duplicate instance detection (#31008)
This commit is contained in:
parent
9600643860
commit
0e2c6c8989
|
@ -439,14 +439,12 @@ impl NodeInstance {
|
||||||
Self { wallclock, ..*self }
|
Self { wallclock, ..*self }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the crds-value is a duplicate instance
|
// Returns true if the crds-value is a duplicate instance of this node,
|
||||||
// of this node, with a more recent timestamp.
|
// with a more recent timestamp.
|
||||||
// The older instance is considered the duplicate instance because:
|
// The older instance is considered the duplicate instance. If a staked
|
||||||
// - If a staked node is restarted it will receive its old instance value
|
// node is restarted it will receive its old instance value from gossip.
|
||||||
// from gossip. Considering the new instance as the duplicate would
|
// Considering the new instance as the duplicate would prevent the node
|
||||||
// prevent the node from restarting.
|
// from restarting.
|
||||||
// - Similarly, hotswap relies on the the old instance being considered the
|
|
||||||
// duplicate instance.
|
|
||||||
pub(crate) fn check_duplicate(&self, other: &CrdsValue) -> bool {
|
pub(crate) fn check_duplicate(&self, other: &CrdsValue) -> bool {
|
||||||
match &other.data {
|
match &other.data {
|
||||||
CrdsData::NodeInstance(other) => {
|
CrdsData::NodeInstance(other) => {
|
||||||
|
|
Loading…
Reference in New Issue