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
fix(orc8r): add reindexing of gateway subscriber state to subscriberdb indexer #13041
fix(orc8r): add reindexing of gateway subscriber state to subscriberdb indexer #13041
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
lte/cloud/go/services/subscriberdb/servicers/protected/indexer_servicer_test.go
Outdated
Show resolved
Hide resolved
lte/cloud/go/services/subscriberdb/servicers/protected/indexer_servicer_test.go
Outdated
Show resolved
Hide resolved
lte/cloud/go/services/subscriberdb/servicers/protected/indexer_servicer.go
Outdated
Show resolved
Hide resolved
42011d3
to
7f6a6a0
Compare
0c7de2a
to
92a7860
Compare
@@ -111,7 +111,7 @@ subscriberdb: | |||
orc8r.io/state_indexer: "true" | |||
orc8r.io/swagger_spec: "true" | |||
annotations: | |||
orc8r.io/state_indexer_types: "mobilityd_ipdesc_record" | |||
orc8r.io/state_indexer_types: "mobilityd_ipdesc_record,gateway_subscriber_state" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[yamllint] reported by reviewdog 🐶
[error] wrong indentation: expected 5 but found 6 (indentation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about that. I didn't touch the indentation and the other lines also have 6...
ced38ec
to
8e71e46
Compare
Modifies the existing indexer servicer by adding the subscriber storage table to it and functionality to take states of type "gateway_subscriber_state" (sent by sessiond) and write an entry for each subscriber into the subscriber storage. For that we modify the existing indexImpl function to distinguish between the two possible types ("mobilityd_ipdesc_record" and "gateway_subscriber_state"). Tests for the new indexer functionality are added. A custom serde type is registered for the gateway subscriber state and implemented in storage/subscriber_state.go. The existing interface of the subscriber storage is changed to use this new type (GatewaySubscriberState). Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
To trigger the indexer also for the type gateway_subscriber_state the annotation is added to the service registry config of subscriberdb. k8s config is added in a separated PR. Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
8e71e46
to
793ba11
Compare
…b indexer (magma#13041) * Add reindexing of gateway_subscriber_state to subscriberdb indexer Modifies the existing indexer servicer by adding the subscriber storage table to it and functionality to take states of type "gateway_subscriber_state" (sent by sessiond) and write an entry for each subscriber into the subscriber storage. For that we modify the existing indexImpl function to distinguish between the two possible types ("mobilityd_ipdesc_record" and "gateway_subscriber_state"). Tests for the new indexer functionality are added. A custom serde type is registered for the gateway subscriber state and implemented in storage/subscriber_state.go. The existing interface of the subscriber storage is changed to use this new type (GatewaySubscriberState). Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> * Add "gateway_subscriber_state" annotation To trigger the indexer also for the type gateway_subscriber_state the annotation is added to the service registry config of subscriberdb. k8s config is added in a separated PR. Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Summary
This PR adds capabilities to subscriberdb indexer to write state of type
gateway_subscriber_state
into thegateway_subscriber_states
table created in #12949. The logic implemented there splits up the state into its entries and renews the entire state with every indexing run (old entries are deleted and new entries are written intogateway_subscriber_states
table).The second commit adds annotations such that the indexer is triggered for this type as well in docker and k8s deployments.
This is the follow up PR to #12949 and implements step 3 of the plan outlined in #8621 - comment.
Test Plan
Manual testing is done with grpcurl and the following commands.
The state is written to
states
table and the indexer writes its entries to thegateway_subscriber_states
table.the
gateway_subscriber_states
table is indeed empty.also works. The respective states get written into the
gateway_subscriber_states
table as above andsubscriberdb_ip_to_imsi
.Additional Information