• Robert Haas's avatar
    Adjust assertion in GetCurrentCommandId. · cce1ecfc
    Robert Haas authored
    currentCommandIdUsed is only used to skip redundant increments of the
    command counter, and CommandCounterIncrement() is categorically denied
    under parallelism anyway.  Therefore, it's OK for
    GetCurrentCommandId() to mark the counter value used, as long as it
    happens in the leader, not a worker.
    
    Prior to commit e9baa5e9, the slightly
    incorrect check didn't matter, but now it does.  A test case added by
    commit 18042840 uncovered the problem
    by accident; it caused failures with force_parallel_mode=on/regress.
    
    Report and review by Andres Freund.  Patch by me.
    
    Discussion: http://postgr.es/m/20171221143106.5lhtygohvmazli3x@alap3.anarazel.de
    cce1ecfc
xact.c 163 KB