GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(locality): coordinate admission across identity and route updates · arencloud/unf@554b664

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/unf-locality
    • examples/support
      • kernel_bank.rs
    • src
      • admission.rs
      • admission
        • tests.rs
      • lib.rs
  • docs
    • adr
      • 0419-coordinated-locality-admission.md
    • development
      • phase9-required-locality-plan.md
  • hack
    • verify-locality-incarnation-gate.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/unf-locality/examples/support/kernel_bank.rs‎

Copy file name to clipboardExpand all lines: crates/unf-locality/examples/support/kernel_bank.rs
+77-3Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use unf_cni_state::{
1515
use unf_ebpf_common::locality::{ABI_VERSION, PACKET_DSR_PENDING, PacketInput};
1616
use unf_encryption::EncryptionLocalityContext;
1717
use unf_locality::{
18-
IncarnationGate, LeasedLocalityBank, LocalityObservationWorker, LocalityRuntimeMaps,
18+
IncarnationGate, KernelLocalityBank, LeasedLocalityBank, LocalityAdmission,
19+
LocalityApplyComponent, LocalityObservationWorker, LocalityRuntimeMaps,
1920
};
2021
use unf_route::NativeRoutePlan;
2122

@@ -377,6 +378,17 @@ pub async fn verify(
377378
// remain live. Revoking the nonce below cannot be repaired by route state.
378379
probe(&mut object, "target-route-restored-v4", v4, &wire4, 7)?;
379380
probe(&mut object, "target-route-restored-v6", v6, &wire6, 7)?;
381+
let admission = verify_admission(
382+
runtime,
383+
&mut object,
384+
&bank,
385+
journal,
386+
gate,
387+
current,
388+
target_route,
389+
[v4, v6],
390+
)
391+
.await?;
380392
pair(
381393
&mut delivery,
382394
&mut object,
@@ -400,10 +412,10 @@ pub async fn verify(
400412
false,
401413
)?;
402414
ensure!(
403-
bank.publish(&mut runtime, journal, gate, current).is_err(),
415+
admission.publish(&bank, journal, gate, current).is_err(),
404416
"stale original journal cut accepted"
405417
);
406-
runtime.withdraw()?;
418+
admission.withdraw()?;
407419
if let Some(delivery) = &delivery {
408420
delivery.finish()?;
409421
}
@@ -416,3 +428,65 @@ pub async fn verify(
416428
fn runtime_from(object: &Ebpf) -> Result<LocalityRuntimeMaps> {
417429
runtime(object)
418430
}
431+
432+
#[allow(clippy::too_many_arguments)] // Exact live fixture authorities, never reopened pins.
433+
async fn verify_admission(
434+
runtime: LocalityRuntimeMaps,
435+
object: &mut Ebpf,
436+
bank: &KernelLocalityBank,
437+
journal: &AttachmentJournal,
438+
gate: &IncarnationGate,
439+
context: &EncryptionLocalityContext,
440+
route: &NativeRoutePlan,
441+
inputs: [PacketInput; 2],
442+
) -> Result<LocalityAdmission> {
443+
use LocalityApplyComponent::{Identity, Routing};
444+
let admission = LocalityAdmission::new(runtime)?;
445+
let [v4, v6] = inputs;
446+
let wire4 = packet(v4);
447+
let wire6 = packet(v6);
448+
probe(object, "coordinator-startup-withdrawn", v4, &wire4, 2)?;
449+
let identity = admission.begin(Identity)?;
450+
let routing = admission.begin(Routing)?;
451+
identity.complete(context.identity_epoch, context.identity_revision)?;
452+
ensure!(
453+
admission.publish(bank, journal, gate, context).is_err(),
454+
"pending route writer admitted"
455+
);
456+
probe(object, "coordinator-route-pending", v4, &wire4, 2)?;
457+
// Simulate a real route update interrupted before commit, not merely a
458+
// fabricated status flag. Drop leaves it failed even after route rollback.
459+
route.delete().await?;
460+
drop(routing);
461+
route.apply().await?;
462+
ensure!(
463+
admission.publish(bank, journal, gate, context).is_err(),
464+
"cancelled route writer admitted"
465+
);
466+
probe(object, "coordinator-route-cancelled", v4, &wire4, 2)?;
467+
let routing = admission.begin(Routing)?;
468+
route.readback().await?;
469+
routing.complete(context.identity_epoch, context.routing_revision)?;
470+
admission.publish(bank, journal, gate, context)?;
471+
probe(object, "coordinator-recovered-v4", v4, &wire4, 7)?;
472+
probe(object, "coordinator-recovered-v6", v6, &wire6, 7)?;
473+
let identity = admission.begin(Identity)?;
474+
let routing = admission.begin(Routing)?;
475+
drop(identity);
476+
routing.complete(context.identity_epoch, context.routing_revision)?;
477+
ensure!(
478+
admission.publish(bank, journal, gate, context).is_err(),
479+
"route completion masked failed identity writer"
480+
);
481+
probe(object, "coordinator-identity-cancelled", v4, &wire4, 2)?;
482+
admission
483+
.begin(Identity)?
484+
.complete(context.identity_epoch, context.identity_revision)?;
485+
admission.publish(bank, journal, gate, context)?;
486+
probe(object, "coordinator-settled-v4", v4, &wire4, 7)?;
487+
probe(object, "coordinator-settled-v6", v6, &wire6, 7)?;
488+
println!(
489+
"kernel-locality-admission: PASS decisions=8 pending-writer-denied=true cancelled-writer-denied=true rollback-not-rearmed=true production-integration=false"
490+
);
491+
Ok(admission)
492+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.