Add checks for postgres sequence consistency (#8402)

This commit is contained in:
Erik Johnston 2020-09-28 18:00:30 +01:00 committed by GitHub
parent 5e3ca12b15
commit bd380d942f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 160 additions and 6 deletions

View file

@ -258,6 +258,11 @@ class MultiWriterIdGenerator:
self._sequence_gen = PostgresSequenceGenerator(sequence_name)
# We check that the table and sequence haven't diverged.
self._sequence_gen.check_consistency(
db_conn, table=table, id_column=id_column, positive=positive
)
# This goes and fills out the above state from the database.
self._load_current_ids(db_conn, table, instance_column, id_column)