Not all fields were getting updated in the conflict case. Here’s the fix:
diff --git a/common/persistence/sql/sqlplugin/postgres/execution_maps.go b/common/persistence/sql/sqlplugin/postgres/execution_maps.go
index dc518896..d0044bbf 100644
--- a/common/persistence/sql/sqlplugin/postgres/execution_maps.go
+++ b/common/persistence/sql/sqlplugin/postgres/execution_maps.go
@@ -45,15 +45,12 @@ run_id = $4`
setKeyInMapQueryTemplate = `INSERT INTO %[1]v
(shard_id, domain_id, workflow_id, run_id, %[4]v, %[2]v)
VALUES
(:shard_id, :domain_id, :workflow_id, :run_id, :%[4]v, %[3]v)
ON CONFLICT (shard_id, domain_id, workflow_id, run_id, %[4]v) DO UPDATE
- SET shard_id = excluded.shard_id,
- domain_id = excluded.domain_id,
- workflow_id = excluded.workflow_id,
- run_id = excluded.run_id,
- %[4]v = excluded.%[4]v `
+ SET (shard_id, domain_id, workflow_id, run_id, %[4]v, %[2]v)
+ = (:shard_id, :domain_id, :workflow_id, :run_id, :%[4]v, %[3]v)`