Add ContactInfo handling for shred versioning (#34286)
* handle ContactInfo in places where only LegacyContactInfo was used * missed a spot * missed a spot * import contact info for crds lookup * cargo fmt * rm contactinfo from crds_entry. not supported yet * typo * remove crds.nodes insert for ContactInfo. not supported yet * forgot to remove clusterinfo in remove() * move around contactinfo match arm * remove contactinfo updating crds.shred_version
This commit is contained in:
parent
a583035812
commit
8ed149a3f2
|
@ -3080,6 +3080,7 @@ fn filter_on_shred_version(
|
||||||
if crds.get_shred_version(from) == Some(self_shred_version) {
|
if crds.get_shred_version(from) == Some(self_shred_version) {
|
||||||
values.retain(|value| match &value.data {
|
values.retain(|value| match &value.data {
|
||||||
// Allow contact-infos so that shred-versions are updated.
|
// Allow contact-infos so that shred-versions are updated.
|
||||||
|
CrdsData::ContactInfo(_) => true,
|
||||||
CrdsData::LegacyContactInfo(_) => true,
|
CrdsData::LegacyContactInfo(_) => true,
|
||||||
CrdsData::NodeInstance(_) => true,
|
CrdsData::NodeInstance(_) => true,
|
||||||
// Only retain values with the same shred version.
|
// Only retain values with the same shred version.
|
||||||
|
@ -3089,6 +3090,7 @@ fn filter_on_shred_version(
|
||||||
values.retain(|value| match &value.data {
|
values.retain(|value| match &value.data {
|
||||||
// Allow node to update its own contact info in case their
|
// Allow node to update its own contact info in case their
|
||||||
// shred-version changes
|
// shred-version changes
|
||||||
|
CrdsData::ContactInfo(node) => node.pubkey() == from,
|
||||||
CrdsData::LegacyContactInfo(node) => node.pubkey() == from,
|
CrdsData::LegacyContactInfo(node) => node.pubkey() == from,
|
||||||
CrdsData::NodeInstance(_) => true,
|
CrdsData::NodeInstance(_) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
|
@ -3107,6 +3109,11 @@ fn filter_on_shred_version(
|
||||||
{
|
{
|
||||||
Some(msg)
|
Some(msg)
|
||||||
}
|
}
|
||||||
|
CrdsData::ContactInfo(node)
|
||||||
|
if node.shred_version() == 0 || node.shred_version() == self_shred_version =>
|
||||||
|
{
|
||||||
|
Some(msg)
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
stats.skip_pull_shred_version.add_relaxed(1);
|
stats.skip_pull_shred_version.add_relaxed(1);
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in New Issue