I wrote:
> As an investigative measure, I propose that we insert
> Assert(MyPgXact->xmin == InvalidTransactionId);
> into 9.4's DefineIndex, just after its InvalidateCatalogSnapshot call.
Well, isn't this interesting:
TRAP: FailedAssertion("!(MyPgXact->xmin == ((TransactionId) 0))", File: "indexcmds.c", Line: 777)
2018-04-16 02:41:25.814 PDT [5ad46fbd.5412:2] LOG: server process (PID 21777) was terminated by signal 6: Aborted
2018-04-16 02:41:25.814 PDT [5ad46fbd.5412:3] DETAIL: Failed process was running: CREATE INDEX CONCURRENTLY
concur_index1ON concur_heap(f2,f1);
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=okapi&dt=2018-04-16%2009%3A35%3A02
So we can now refine the problem statement to "SnapshotResetXmin isn't
doing what it's supposed to". No idea why yet. 9.4 is using a simple
RegisteredSnapshots counter which 9.5 has replaced with a pairing heap,
so you'd think the newer code would be *more* likely to have bugs...
regards, tom lane