Skip to content

gNMI OnceSync: scoped refresh and serialized cycles - #502

Open
steiler wants to merge 2 commits into
synced-gatefrom
gnmi-oncesync
Open

steiler wants to merge 2 commits into
synced-gatefrom
gnmi-oncesync

Conversation

@steiler

@steiler steiler commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Implement gNMI sync mode once: subscribe-ONCE cycles update Running via the same scoped-refresh path as GetSync (applyScopedRefreshFromCycleTree).
  • Latch MarkSynced only after a successful apply on SyncResponse; subscribe failures or streams that end without SyncResponse do not commit.
  • Serialize cycles (cycleRunning) so interval ticks skip while a cycle is in flight; parse sync paths and wire schemaClient at construction (invalid paths fail in AddSyncs).
  • Update CONTEXT.md Synced glossary to include OnceSync (Phase B of running-sync-empty-and-once).

Stacks on #501 (synced-gate). Parent spec: .scratch/open/09-running-sync-empty-and-once-spec.md.

Test plan

  • go test ./pkg/datastore/target/gnmi/ -run OnceSync
  • go test ./...
  • Manual: datastore with mode: once sync against a target that returns ONCE + SyncResponse

Wire subscribe-ONCE through the same Running apply path as GetSync, latch Synced only after SyncResponse and successful apply, and skip interval ticks while a cycle is in flight.
@steiler
steiler requested a review from a team as a code owner September 24, 2026 07:46
@steiler
steiler added this pull request to stack #503 September 24, 2026 07:47
gotSyncResponse is only read when the subscribe stream closes; assigning it before return was unused.
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.82278% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/datastore/target/gnmi/once.go 68.42% 17 Missing and 7 partials ⚠️
pkg/datastore/target/gnmi/gnmi.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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