Round Update: v44/v45 Posted, Naming Settled, New Bugs Surface
This round sees significant progress on multiple fronts: naming conventions finalized per Amit's direction, patches v44 and v45 posted, Peter Smith's enum-vs-string proposal rejected, and several new bugs discovered by Nisha and Zsolt.
Naming Decisions Finalized (Amit, June 1)
Amit settled the naming bikeshed with concrete directives:
GetLogDestination()→GetConflictLogDest()drop_sub_dependencies()→drop_sub_conflict_log_table()(too generic before)CONFLICTS_LOGGED_TO_FILE()→CONFLICTS_LOGGED_TO_LOG()("File" not PostgreSQL terminology)IsConflictNamespace()→IsConflictLogTableNamespace()(consistency withIsConflictLogTableClass())
Dilip incorporated all of these in v44.
Peter Smith's enum→string Proposal Rejected
Peter proposed changing conflict_log_destination from an enum (log/table/all) to a comma-separated string like the publish option, arguing it's more future-proof for N-way combinations. Amit rejected this: all remains useful as shorthand, and the current enum can be extended to multi-value later if needed.
Patch v44/v45 Structure
Patches reorganized: 0002 merged into 0001, 0004 merged into 0003. v45 adds Vignesh's rebased pg_upgrade and \dRs+ patches (0003, 0004). Key v44 changes:
- ACL restricted to exclude INSERT/UPDATE/USAGE on CLT (only DELETE/TRUNCATE allowed for cleanup)
- CLT name reverted to
pg_conflict_log_<subid>(was briefly changed) - Parallel apply fix from Vignesh integrated
- Nisha's
StaticAssertDeclfix (useCONFLICT_LOG_DEST_ALL + 1instead of hardcoded3) - Public access granted to new
pg_subscriptioncolumns (subconflictlogrelid,subconflictlogdest)
New Bugs Discovered
1. ProcessPendingConflictLogTuple() failure masks original error (Nisha)
If CLT insertion fails in the PG_CATCH path (e.g., relation OID invalid), PG_RE_THROW() is never reached. The original conflict error is lost; only the secondary CLT error is reported. Worker retries indefinitely showing only the CLT error, never the actual conflict.
2. disable_on_error path: CLT failure prevents subscription disable (Nisha)
ProcessPendingConflictLogTuple() is called before the subscription is disabled. If it fails, the subscription never disables and the worker loops forever. Nisha suggests moving it after the disable logic.
3. Premature "logged to" message wording (Nisha) Error message says "Conflict details are logged to the conflict log table" before the write actually occurs. Should say "will be logged" since CLT write is deferred.
4. remote_commit_ts NULL under streaming=on (Nisha)
When streaming=on, the commit timestamp isn't populated in the CLT because apply_handle_stream_commit() doesn't set remote_commit_ts = commit_data.committime in the TRANS_LEADER_APPLY case.
5. Inconsistent UPDATE error for superuser vs. owner (Nisha) Superuser gets the descriptive "cannot modify or insert data into conflict log table" error. The subscription owner (non-superuser) gets a generic "permission denied for table" because ACL check fires before the CLT-specific check.
6. Stale name references (Zsolt)
Several code locations and commit messages still use old pg_conflict_log_for_subid_<oid> naming instead of pg_conflict_log_<subid>.
7. Missing xid/commit_ts in apply_handle_begin_prepare (Zsolt)
apply_handle_begin_prepare doesn't set remote_xid/remote_commit_ts, potentially leaving them uninitialized for prepared transaction conflicts.
Test Infrastructure Issue (Nisha)
The poll_query_until() test for CLT content was silently broken in v44 — when the table doesn't exist, it retries until timeout rather than failing immediately. Nisha suggests wrapping in ok() for proper TAP reporting.