AuroraMeter.Migration.ConcurrentVersionError exception (Aurora Meter v1.0.0)

View Source

Raised by AuroraMeter.Migration.up/1 when a version that must run outside a DDL transaction is asked to run alongside other versions.

Core version 8 creates a unique index CONCURRENTLY, which Postgres refuses inside a transaction block. It therefore needs a host migration of its own carrying @disable_ddl_transaction true and @disable_migration_lock true, which mix aurora_meter.gen.migration generates as a separate file.

The escape is concurrently: false, which builds the index inside the transaction. That is right for a fresh install and for an install whose events table is small enough to lock; it is wrong for a live table with a large number of rows in it.

Summary

Types

t()

@type t() :: %AuroraMeter.Migration.ConcurrentVersionError{
  __exception__: term(),
  concurrent: [pos_integer()],
  message: String.t(),
  versions: [pos_integer()]
}