Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sled-agent] Replace tokio::spawn'd mg-ddm calls with a reconciler task #7521

Open
wants to merge 2 commits into
base: john/no-hidden-tokio-spawn
Choose a base branch
from

Conversation

jgallagher
Copy link
Contributor

Prior to this PR, sled-agent would spawn three infinite retry-until-success tasks on startup:

  1. Sending mg-ddm enough information to turn on its Oximeter stats
  2. Telling mg-ddm to advertise the sled's bootstrap prefix
  3. Telling mg-ddm to advertise the sled's underlay prefix

Additionally, it would spawn an infinite retry-until-success task for any internal DNS zone it started (telling mg-ddm to advertise the internal DNS prefix).

This PR replaces all of these with a DdmReconciler, which is responsible for taking all of the above information and periodically syncing with the local mg-ddm instance to ensure it has up-to-date information.

Fixes #7377. Builds on #7507.

Prior to this PR, sled-agent would spawn three infinite
retry-until-success tasks on startup:

1. Sending mg-ddm enough information to turn on its Oximeter stats
2. Telling mg-ddm to advertise the sled's bootstrap prefix
3. Telling mg-ddm to advertise the sled's underlay prefix

Additionally, it would spawn an infinite retry-until-success task for
any internal DNS zone it started (telling mg-ddm to advertise the
internal DNS prefix).

This PR replaces all of these with a `DdmReconciler`, which is
responsible for taking all of the above information and periodically
syncing with the local mg-ddm instance to ensure it has up-to-date
information.

Fixes #7377.
@jgallagher
Copy link
Contributor Author

Notes from testing on a4x2: On sled startup, we see each of the bootstrap, underlay, and internal-dns prefixes added in turn:

19:11:37.635Z INFO SledAgent (DdmReconciler): attempting to add new prefix advertisements
    file = sled-agent/src/ddm_reconciler.rs:219
    to_advertise = [Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }]
19:11:37.659Z INFO SledAgent (DdmReconciler): completed prefix advertisement reconcilation
    added = [Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }]
    file = sled-agent/src/ddm_reconciler.rs:251
    prefixes = {Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }}
    withdrawn = []
... snip ...
19:14:31.940Z INFO SledAgent (DdmReconciler): attempting to add new prefix advertisements
    file = sled-agent/src/ddm_reconciler.rs:219
    to_advertise = [Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }]
19:14:31.943Z INFO SledAgent (DdmReconciler): completed prefix advertisement reconcilation
    added = [Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }]
    file = sled-agent/src/ddm_reconciler.rs:251
    prefixes = {Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }, Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }}
    withdrawn = []
... snip ...
19:15:04.817Z INFO SledAgent (DdmReconciler): attempting to add new prefix advertisements
    file = sled-agent/src/ddm_reconciler.rs:219
    to_advertise = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]
19:15:04.817Z INFO SledAgent (DdmReconciler): completed prefix advertisement reconcilation
    added = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]
    file = sled-agent/src/ddm_reconciler.rs:251
    prefixes = {Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }, Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }, Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }}
    withdrawn = []

Expunging the internal-dns zone results in its prefix being withdrawn:

21:51:15.823Z INFO SledAgent (DdmReconciler): attempting to withdraw prefix advertisements
    file = sled-agent/src/ddm_reconciler.rs:236
    to_withdraw = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]
21:51:15.856Z INFO SledAgent (DdmReconciler): completed prefix advertisement reconcilation
    added = []
    file = sled-agent/src/ddm_reconciler.rs:251
    prefixes = {Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }, Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }}
    withdrawn = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]

and adding it back results in it being advertised again:

21:54:16.328Z INFO SledAgent (DdmReconciler): attempting to add new prefix advertisements
    file = sled-agent/src/ddm_reconciler.rs:219
    to_advertise = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]
21:54:16.349Z INFO SledAgent (DdmReconciler): completed prefix advertisement reconcilation
    added = [Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }]
    file = sled-agent/src/ddm_reconciler.rs:251
    prefixes = {Ipv6Net { addr: fd00:1122:3344:1::, width: 64 }, Ipv6Net { addr: fd00:1122:3344:101::, width: 64 }, Ipv6Net { addr: fdb0:a840:2500:1::, width: 64 }}
    withdrawn = []

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.

1 participant