VOIP-1284-Migrate-tickers-to-schedule-manager - #1157
Merged
Conversation
- bin-billing-manager: Fix AccountTopUpTokens CAS race and add /v1/accounts/top_up schedule endpoint; add /v1/failed_events/retry endpoint with main.go restructure - bin-ai-manager: Add /v1/aipromptproposals/expire schedule endpoint, remove the proposal-sweep ticker - bin-customer-manager: Fix CustomerAnonymizePII double-publish race; add /v1/customers/cleanup_unverified and /v1/customers/cleanup_frozen_expired schedule endpoints, remove both cleanup tickers - bin-dbscheme-manager: Seed the five Phase 2 schedules (billing top-up, billing failed-event retry, ai proposal expiry, customer unverified cleanup, customer frozen expiry)
- bin-billing-manager: Sync docs/architecture.md routing table with the new schedule-triggered endpoints - bin-ai-manager: Sync docs/architecture.md routing table with the new schedule-triggered endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of bin-schedule-manager (VOIP-1283): migrates five in-process time.Ticker jobs — billing-manager monthly token top-up, billing-manager failed-event retry, ai-manager expired-proposal sweep, customer-manager unverified-customer cleanup, customer-manager frozen-customer expiry — into schedule-manager-dispatched RPC endpoints. All three touched services already run replicas:2 in production, so the double-fire hazard these tickers carried (no leader election, no lock) was live, not theoretical. Two real concurrency bugs found during investigation are fixed as part of this migration: AccountTopUpTokens had no CAS guard (ledger could double-insert under concurrent replicas); CustomerAnonymizePII had no status guard (could publish customer_deleted twice, double-triggering the number-manager/billing-manager cascade). VOIP-1282 (campaign-manager/queue-manager) concluded neither needs schedule-manager — both are already self-driving via RabbitMQ delayed-message self-RPC — so this PR does not touch them. Design approved over 3 review rounds, implementation plan over 6 rounds, code over 3 rounds (all Approve). No bin-common-handler changes: schedules dispatch generically via target_queue/target_uri, same as Phase 1's number-renew.
Sandbox replica-guard removal (scripts/voipbin-cli.py) is a separate, later PR in the sandbox repo, sequenced after these images are released and pinned — not part of this PR.