Advisory lock ids
Which Postgres advisory lock id each background worker holds, and how to take a new one.
Background workers elect one leader per cycle with a Postgres advisory lock (pg_try_advisory_lock). Two workers
that share an id silently skip each other's cycles, so every id has exactly one holder. The code is the
authority: the ADVISORY_LOCK_* constants and the lists of packages/core/src/nistor_core/aggregations/base/background_task_base.py, checked at import time and by
packages/core/tests/test_plugin_advisory_locks.py and packages/core/tests/test_advisory_lock_registry_completeness.py.
Plugins declare their ids in PluginManifest.advisory_lock_ids; the manifest loader refuses a plugin whose ids
collide with core's, with a retired id, with an id core handed to another plugin, or with another plugin's.
This page renders the registry and adds the ids reserved by work that has not landed yet.
Taking an id#
- Next free id: 1_001_075.
- Core constants on this tree: 38 (the count
test_registered_ids_are_core_s_constantsasserts). - Add the constant to the registry with a comment naming the worker, update the count, re-render this page.
Registry#
| id | constant | owner | added by |
|---|---|---|---|
| 1_001_001 | ADVISORY_LOCK_ACTION_RUN_CONSOLIDATION |
core | registry constant |
| 1_001_002 | — | plugin data_quality |
handed over by core |
| 1_001_003 | ADVISORY_LOCK_INCIDENT_HISTORY_CONSOLIDATION |
core | registry constant |
| 1_001_004 | ADVISORY_LOCK_INPUT_LOGS_CONSOLIDATION |
core | registry constant |
| 1_001_005 | ADVISORY_LOCK_INPUT_LOGS_WRITERS_CONSOLIDATION |
core | registry constant |
| 1_001_006 | ADVISORY_LOCK_PAGE_VIEW_CONSOLIDATION |
core | registry constant |
| 1_001_007 | — | plugin finops |
handed over by core |
| 1_001_008 | — | plugin finops |
handed over by core |
| 1_001_009 | ADVISORY_LOCK_NODE_POPULARITY_CONSOLIDATION |
core | registry constant |
| 1_001_010 | ADVISORY_LOCK_PAGE_VIEW_BACKFILL |
core | registry constant |
| 1_001_011 | ADVISORY_LOCK_COVERAGE_SNAPSHOT |
core | registry constant |
| 1_001_012 | ADVISORY_LOCK_INCIDENT_ESCALATION |
core | registry constant |
| 1_001_013 | — | plugin finops |
handed over by core |
| 1_001_014 | ADVISORY_LOCK_IDEMPOTENCY_GC |
core | registry constant |
| 1_001_015 | ADVISORY_LOCK_DATA_TRUST_HEALTH |
core | registry constant |
| 1_001_016 | — | plugin data_quality |
handed over by core |
| 1_001_017 | — | retired, never reassigned | registry list |
| 1_001_018 | ADVISORY_LOCK_INCIDENT_HEARTBEAT |
core | registry constant |
| 1_001_019 | — | plugin finops |
handed over by core |
| 1_001_020 | ADVISORY_LOCK_FRESHNESS_FORECAST |
core | registry constant |
| 1_001_021 | ADVISORY_LOCK_PERSONAL_DIGEST |
core | registry constant |
| 1_001_022 | ADVISORY_LOCK_INCIDENT_RUN_RECONCILE |
core | registry constant |
| 1_001_023 | ADVISORY_LOCK_PRESENCE_GC |
core | registry constant |
| 1_001_024 | ADVISORY_LOCK_REVERSIBLE_OPS_GC |
core | registry constant |
| 1_001_025 | — | plugin ai |
handed over by core |
| 1_001_026 | — | plugin ai |
handed over by core |
| 1_001_027 | ADVISORY_LOCK_CHAIN_REAPER |
core | registry constant |
| 1_001_028 | ADVISORY_LOCK_MSTR_ATTRIBUTION |
core, out of registry: MicroStrategy attribution reaper, the tool's own id since phase 5 Task 12b (packages/integrations/microstrategy/src/nistor_tool_microstrategy/services/attribution_reaper.py) | packages/integrations/microstrategy/src/nistor_tool_microstrategy/services/attribution_reaper.py |
| 1_001_029 | — | plugin data_quality |
handed over by core |
| 1_001_030 | — | plugin data_quality |
handed over by core |
| 1_001_031 | — | plugin data_quality |
handed over by core |
| 1_001_032 | — | plugin ai |
handed over by core |
| 1_001_033 | — | retired, never reassigned | registry list |
| 1_001_034 | — | plugin data_quality |
handed over by core |
| 1_001_035 | ADVISORY_LOCK_CHECK_ACTIONS |
core | registry constant |
| 1_001_036 | — | plugin ai |
handed over by core |
| 1_001_037 | — | plugin ai |
handed over by core |
| 1_001_038 | — | plugin ai |
handed over by core |
| 1_001_039 | — | plugin catalog |
handed over by core |
| 1_001_040 | — | plugin ai |
handed over by core |
| 1_001_041 | — | plugin data_quality |
handed over by core |
| 1_001_042 | PeriodicTask(advisory_lock_id=) |
core, out of registry: bq_write_visibility worker lock (services/backend/nistor_backend/aggregations/bq_write_visibility/background_task.py) | services/backend/nistor_backend/aggregations/bq_write_visibility/background_task.py |
| 1_001_043 | ADVISORY_LOCK_COMPILATION_RELOAD_BASE |
core, out of registry: compilation reload instance-lock base, the high half of its key (services/backend/nistor_backend/services/compilation/reload_policy.py) | services/backend/nistor_backend/services/compilation/reload_policy.py |
| 1_001_044 | ADVISORY_LOCK_COST_RECONCILER |
core | registry constant |
| 1_001_045 | — | retired, never reassigned | registry list |
| 1_001_046 | ADVISORY_LOCK_RULE_TRIGGER_LIVENESS |
core | registry constant |
| 1_001_047 | — | plugin data_quality |
handed over by core |
| 1_001_048 | ADVISORY_LOCK_RULE_TARGET_RESOLUTION |
core | registry constant |
| 1_001_049 | ADVISORY_LOCK_RULE_REFRESH_SLA |
core | registry constant |
| 1_001_050 | ADVISORY_LOCK_RULE_PERMISSION_PREFLIGHT |
core | registry constant |
| 1_001_051 | ADVISORY_LOCK_RULE_PERMISSION_INCIDENTS |
core | registry constant |
| 1_001_052 | — | retired, never reassigned | registry list |
| 1_001_053 | — | retired, never reassigned | registry list |
| 1_001_054 | — | retired, never reassigned | registry list |
| 1_001_055 | — | retired, never reassigned | registry list |
| 1_001_056 | — | retired, never reassigned | registry list |
| 1_001_057 | — | retired, never reassigned | registry list |
| 1_001_058 | — | retired, never reassigned | registry list |
| 1_001_059 | — | plugin advisor |
handed over by core |
| 1_001_060 | ADVISORY_LOCK_DEPLOYMENT_REPORT_REMATCH |
core | registry constant |
| 1_001_061 | ADVISORY_LOCK_SCHEDULER_LIVENESS |
core | registry constant |
| 1_001_062 | ADVISORY_LOCK_BACKFILL_DRIVER |
core | registry constant |
| 1_001_063 | ADVISORY_LOCK_FRESHNESS_EVALUATOR |
core | registry constant |
| 1_001_064 | ADVISORY_LOCK_CRON_ON_HOLD_ACTIONS |
core | registry constant |
| 1_001_065 | ADVISORY_LOCK_CRON_CHECK_ACTIONS_STATUS |
core | registry constant |
| 1_001_066 | ADVISORY_LOCK_CRON_ON_HOLD_CHECK |
core | registry constant |
| 1_001_067 | ADVISORY_LOCK_CRON_RESOURCE_WATCH_POLL |
core | registry constant |
| 1_001_068 | ADVISORY_LOCK_CRON_BIGQUERY_STREAMING_MONITOR |
core | registry constant |
| 1_001_069 | ADVISORY_LOCK_CRON_DEAD_LETTER_DRAIN |
core | registry constant |
| 1_001_070 | ADVISORY_LOCK_BULK_REPLAY_DRIVER |
core | registry constant |
| 1_001_071 | ADVISORY_LOCK_RUNNER_LEASE_EXPIRY |
core | registry constant |
| 1_001_074 | ADVISORY_LOCK_NODE_TEAM_SYNC |
core | registry constant |
| 8_675_309 | _ADVISORY_LOCK_KEY |
core, out of registry: catalog_node write lock (services/backend/nistor_backend/crud/catalog_node.py, also catalog_sync.py) | services/backend/nistor_backend/crud/catalog_node.py |
| 8_675_310 | _ADVISORY_LOCK_KEY |
core, out of registry: node_detail heavy-blob write lock (services/backend/nistor_backend/crud/node_detail.py) | services/backend/nistor_backend/crud/node_detail.py |
| 0x6E697374 | MIGRATION_LOCK_KEY |
core, out of registry: test-database migration lock (packages/testing/src/nistor_testing/migrations.py) | packages/testing/src/nistor_testing/migrations.py |
| 0x6E6D6967 | MIGRATE_LOCK_KEY |
core, out of registry: migrate-job lock, held by nistor migrate for its whole run (packages/core/src/nistor_core/general/migrations/runner.py) | packages/core/src/nistor_core/general/migrations/runner.py |
| 202_607_120_001 | _SCHEMA_BOOTSTRAP_LOCK_KEY |
core, out of registry: test-database schema-bootstrap lock (packages/testing/src/nistor_testing/backend.py) | packages/testing/src/nistor_testing/backend.py |
| 0x6A5F617373657475 | _ASSET_UPSERT_LOCK_KEY |
core, out of registry: asset upsert lock (packages/core/src/nistor_core/assets/crud.py) | packages/core/src/nistor_core/assets/crud.py |
| 0x6A5F677261706864 | _SEQ_LOCK_KEY |
core, out of registry: graph delta sequence lock (services/backend/nistor_backend/crud/graph_delta.py) | services/backend/nistor_backend/crud/graph_delta.py |
| 0x6A5F707265736574 | _DEFAULT_PRESET_LOCK_KEY |
core, out of registry: default-preset choice lock (services/backend/nistor_backend/crud/iam_role_template.py) | services/backend/nistor_backend/crud/iam_role_template.py |