world-federation-of-advertisers / cross-media-measurement

A privacy centric system for cross publisher, cross media ads measurement through secure multiparty computations.
https://halo.wfanet.org/
Apache License 2.0
36 stars 11 forks source link

fix!: Ensure that MeasurementIndexShardId is non-negative #1863

Closed SanjayVas closed 1 month ago

SanjayVas commented 1 month ago

BREAKING CHANGE: This is updating an existing Liquibase changeset, and will therefore require manual adjustments wherever it has been rolled out. This should only have rolled out to Halo test environments.

Closes #1862

wfa-reviewable commented 1 month ago

This change is Reviewable

SanjayVas commented 1 month ago

Statements to roll back previous schema change:

DROP INDEX MeasurementsByContinuationToken;

ALTER TABLE Measurements
DROP COLUMN MeasurementIndexShardId;

CREATE INDEX MeasurementsByContinuationToken ON Measurements(
  UpdateTime,
  ExternalComputationId,
  State
);

DELETE FROM DATABASECHANGELOG
WHERE
  id = '21'
  AND author = 'sanjayvas'
  AND filename = 'kingdom/spanner/shard-measurements-by-continuation-token.sql';

I've already run this on halo-cmm-head and halo-cmm-qa. It will need to be re-run if the bad schema update is re-applied, e.g. by the Kingdom internal server restarting.

SanjayVas commented 1 month ago

I re-ran the statements on halo-cmm-head as it had gotten redeployed without this change.