-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
5
-
True
-
-
False
-
-
-
5
- The unit_of_measure column is currently part of the tally_snapshot uniqueness constraint, but it is no longer needed and can be removed from the table. The issue arises because PostgreSQL does not treat NULL values as part of a uniqueness constraint, which can result in duplicate records.
- The columns snapshot_date, org_id, product_id, and granularity currently allow NULL values, but they should have NOT NULL constraints to ensure data integrity.
We discovered an issue in CI pipelines which we suspect there might be a "potential" race condition during the retally(same tally rerun again) process, where the tally_state table is not being properly locked. This could lead to the creation of duplicate entries in the tally_snapshot table.
TODO - split cards
- API to delete rows where there are nulls in any of those columns
- THEN Add constraint (liquibase)
- DROP UOM column (liquibase) from tally_snapshot, adjust the the uniqueness constraint if it doesn't update that automatically
Acceptance criteria:
- unit_of_measure column is removed from the table.
- add billing_provider and billing_account_id columns into the unique index.
- Not null constraints are added to the org_id, snapshot_date, granularity, and product_id columns.
- Enable Test MR: SWATCH-3466 [Make the sync_tally method more robust|iqe test]
- Make sure in stage applying unique constraint is quick and doesn't cause any db issues.
- is blocked by
-
SWATCH-3502 Purge tally_snapshots and tally_measurements with org_id is null
-
- Backlog
-
-
SWATCH-3503 Spike: clarify the tally_snapshots duplications
-
- Backlog
-
-
SWATCH-3680 SPIKE: Evaluate large table migration pattern and explore alternatives
-
- Backlog
-
- relates to
-
SWATCH-3479 Potential race condition during hourly tally process
-
- Backlog
-