Skip to content

Commit

Permalink
incorrect assignment of txid in the precommit (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
charithabandi authored Jan 9, 2025
1 parent a45e3d8 commit ebd06c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions node/pg/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,12 @@ func (db *DB) precommit(ctx context.Context, changes chan<- any) ([]byte, error)
return nil, errors.New("replication connection is down")
}

db.txid = random.String(10)
sqlPrepareTx := fmt.Sprintf(`PREPARE TRANSACTION '%s'`, db.txid)
txid := random.String(10)
sqlPrepareTx := fmt.Sprintf(`PREPARE TRANSACTION '%s'`, txid)
if _, err := db.tx.Exec(ctx, sqlPrepareTx); err != nil {
return nil, err
}
db.txid = txid

logger.Debugf("prepared transaction %q", db.txid)

Expand Down

0 comments on commit ebd06c0

Please sign in to comment.