Skip to content

fix(nefd,udmd): Nnef_EventExposure subscribers get TS 29.591 notifications, an old udmd is refreshed, no leading-zero index (#2154) - #2158

Open
parlakisik wants to merge 1 commit into
mainfrom
b2-2154-nefd-followups
Open

parlakisik wants to merge 1 commit into
mainfrom
b2-2154-nefd-followups

Conversation

@parlakisik

Copy link
Copy Markdown
Contributor

Closes #2154.

These are R42's three follow-ups from the #2152 review.

Verified against main (#2152 merged)

Item On main
1. Nnef_EventExposure subscribers get T8-shaped notifications, including the #2133 cancelInd True. build_monitoring_notification and cancellation_notification never consult the API, and the subscription records none
2. A new nefd against an old udmd fails every refresh with 400 True. A udmd from before #2133 accepts only top-level patch paths
3. udmd accepts an array index with a leading zero True. str::parse::<usize> accepts 01, and also +1

TS 29.591 NefEventExposureNotif is {notifId (M), eventNotifs: [NefEventNotification {event (M), timeStamp (M), ...}] (M)}. NefEvent has no LOCATION_REPORT, UE_REACHABILITY or LOSS_OF_CONNECTIVITY value, but admits a free-form string. Nothing in TS 29.591 carries a cancellation indication.

Changes

  1. nefd notification shape. The new NefMonitoringSubscription.northbound_api records the API a subscription was made on. It defaults to T8 when deserialised, so a record from before nefd/udmd: #2152 follow-ups (29.591 notification shape, udmd-first upgrade order, JSON Pointer leading zeros) #2154 reads as what it was notified in.
    • A Nnef_EventExposure subscriber now gets {notifId: <its notifId>, eventNotifs: [{event: <the eventId it subscribed to>, timeStamp: <the producer's, else now>}]}.
    • When the NEF removes such a subscription on its own initiative, nothing is sent, because no indication is defined.
    • Ceilings, in nef.md: TS 29.591 has no member for the report data, and no cancellation indication.
  2. Upgrade order. udmd must be upgraded before nefd; this is written in a new CHANGELOG "Upgrade notes" section and in nef.md. I also took the optional fallback: when the UDM answers 400 to the add /reportingOptions/expiry refresh, nefd retries once with the whole-object form, so legs keep being refreshed during a rolling upgrade.
  3. udmd array index. An index must be 0 or have no leading zero (RFC 6901 §4). A sign is refused too.

Acceptance vs evidence (each revert done on its own, restored, and checked with diff)

Item Test Revert, and what fails
1 shape a_nnef_subscriber_is_notified_in_the_ts_29_591_shape_2154: the exact NefEventExposureNotif goes to a Nnef subscriber and a T8 body to a T8 one, and LOCATION_REPORTING maps back to LOCATION_REPORT. nnef_event_exposure_subscribe_is_served_... now also asserts that the created subscription records NnefEventExposure API branch removed: the Nnef subscriber gets T8, and the exact-body assertion fails
1 cancel nnef_removals_send_nothing_and_an_old_udm_is_refreshed_2154: the T8 subscriber gets its cancelInd, and the Nnef one gets nothing Nnef branch removed: fails at "nothing for the Nnef consumer". The log shows a T8 cancellation POSTed to it
2 Same test: an old-udmd stand-in sees the member form and then the object form, once, and the leg is refreshed Fallback removed: the report shows refreshed: 0, and the test fails
3 ee_patch_refuses_an_array_index_with_a_leading_zero_2154: 01, 00, +1 and 1a are refused and change nothing; 0 and 10 work Index back on str::parse: the test fails

Gates (local)

  • cargo fmt --all --check.
  • clippy --all-targets -D warnings for udmd and nefd, plus nefd --features demo-d445a-fl-t8.
  • Full suites for udmd and nefd.
  • The nefd 2154 tests looped 3 times.
  • The workspace run is left to CI.

…tions, an old udmd is refreshed, no leading-zero index (#2154)

R42 on #2152:
- nefd records the northbound API each subscription was made on. A
  Nnef_EventExposure subscriber is now notified with a TS 29.591
  NefEventExposureNotif (notifId; eventNotifs[{event, timeStamp}]) instead
  of a T8 MonitoringNotification. TS 29.591 defines no cancellation
  indication, so none is sent to it when the NEF removes its subscription.
  Both ceilings are documented in nef.md.
- Upgrade order: udmd before nefd (CHANGELOG, nef.md). As a fallback, a 400
  to the `add /reportingOptions/expiry` refresh (a udmd from before #2133)
  is retried once with the whole object.
- udmd refuses a JSON Pointer array index with a leading zero or a sign
  (RFC 6901 §4).

Spec: specs/nefd-udmd-2152-followups-2154.md
@parlakisik

Copy link
Copy Markdown
Contributor Author

R42 review: #2158 (head a2883d8, Closes #2154)

Tested on a2883d8, which is already up to date with origin/main (including the merged #2152). cargo test -p nextgcore-nefd -p nextgcore-udmd passes on all 8 result lines.

TS 29.591 reading is correct. I checked it against the TS29591_Nnef_EventExposure OpenAPI:

  • NefEventExposureNotif is {notifId, eventNotifs (minItems 1)}, both required.
  • NefEventNotification requires event and timeStamp; its other members are the TS 29.591 event infos, none of them a location, reachability or loss-of-connectivity report.
  • NefEvent has no LOCATION_REPORT, UE_REACHABILITY or LOSS_OF_CONNECTIVITY value but admits a free-form string.
  • No schema carries a termination or cancellation indication; removal is the consumer's DELETE.

So sending nothing to a TS 29.591 consumer on a NEF-initiated removal, and documenting that ceiling, is the right mapping. Inventing a cancelInd there would be wrong.

Verified. Each revert below was a behavioural edit run on its own; I restored each and the tree is clean.

  • T8 subscribers keep the TS 29.122 shape; Nnef_EventExposure subscribers get NefEventExposureNotif. Shape branch disabled: a_nnef_subscriber_is_notified_in_the_ts_29_591_shape_2154 fails at main.rs:6022. The create path always tagging T8: nnef_event_exposure_subscribe_is_served_and_unsupported_events_are_refused fails at :5498. The event mapping (NNEF_EVENT_TO_MONITORING_TYPE) is 1:1, so mapping back is unambiguous.
  • No cancellation to a Nnef subscriber; the T8 subscriber still gets cancelInd: true. Skip disabled: nnef_removals_send_nothing_and_an_old_udm_is_refreshed_2154 fails at :4378 "nothing for the Nnef consumer", and its log shows the T8 body posted to it.
  • Old-udmd fallback (one retry in the object form after a 400). Fallback removed: the same test fails at :4356 with refreshed: 0, lapsed: 2.
  • RFC 6901 §4 index. Back on str::parse: ee_patch_refuses_an_array_index_with_a_leading_zero_2154 fails at udmd/src/app.rs:6385.
  • The API tag across a restart: holds, but nothing in the PR tests it. I wrote a local probe (not pushed). It inserts a Nnef subscription and a T8 one with a state file, strips northbound_api from the T8 record on disk to simulate a pre-nefd/udmd: #2152 follow-ups (29.591 notification shape, udmd-first upgrade order, JSON Pointer leading zeros) #2154 snapshot, then restarts. The Nnef subscription restores as NnefEventExposure and the stripped one as T8MonitoringEvent. With the field set to #[serde(skip)], only my probe fails; every PR test stays green.

Interaction with #2152 and #2155. #2152 is merged, and this branch already contains it. #2155 (open, approved) conflicts with this PR in nefd/src/main.rs only, at the same test-insertion point where it conflicted with #2152. Keeping both sides resolves it, and udmd auto-merges. They don't depend on each other semantically: #2155's PatchResult parse in confirmed_expiry applies to whichever form this PR's fallback sends, and against a new udmd the fallback only fires on a 400. Merge order is free. Whichever lands second rebases, and the second one's suites should be re-run.

minor

  1. Add the restart test above to context.rs: insert one subscription per API with a state file, strip the tag from one record, restart, and assert both tags. Without it, a serde(skip) or a renamed field would silently turn every Nnef subscriber back into a T8 one after a restart. That is the exact regression this PR fixes.
  2. The fallback retries on any 400 from the UDM, including a new udmd refusing a past or malformed expiry. In that case the whole-object retry is also refused (harmless, one extra request), but it still logs "a udmd older than amfd/udmd/nefd: pre-existing subscription lifecycle gaps found in #2128 review #2133?". Consider gating the retry on the problem cause or detail (udmd answers INVALID_MSG_FORMAT for an unaddressable path), or rewording the log line.

VERDICT: APPROVE

@parlakisik parlakisik added the review-approved Independent reviewer agent approved: corner cases, validation, tests, production readiness label Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-approved Independent reviewer agent approved: corner cases, validation, tests, production readiness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nefd/udmd: #2152 follow-ups (29.591 notification shape, udmd-first upgrade order, JSON Pointer leading zeros)

1 participant