gastownhall/beads · error
set dolt_force_transaction_commit: %w
Error message
set dolt_force_transaction_commit: %w
What it means
Immediately after enabling conflict tolerance, MergeAndSettleWithStrategy sets @@dolt_force_transaction_commit=1 so the merge can land despite FK violations for later repair. "set dolt_force_transaction_commit: %w" wraps that SET's failure. Same causes as the allow_commit_conflicts failure: non-Dolt backend, old Dolt version, or dead connection.
Source
Thrown at internal/storage/versioncontrolops/mergesettle.go:69
// MergeAndSettleWithStrategy is MergeAndSettle with an operator escape hatch
// (#4992 part 2): a conflict TryAutoResolveMergeConflicts declines is, when
// strategy is non-empty, resolved with strategy ("ours" or "theirs") instead
// of aborting the merge for the operator. strategy == "" is exactly
// MergeAndSettle's behavior (a declined conflict aborts with
// MergeConflictsError). Used by the embedded pull path's `--strategy` flag;
// see SettleMerge for the resolution logic.
func MergeAndSettleWithStrategy(ctx context.Context, db DBConn, ref, strategy string) error {
// Capture pre-merge cleanliness before anything runs: abortMerge's
// hard-reset fallback is only safe when nothing uncommitted predates
// the merge (bd-578h9.2).
preMergeClean := workingSetClean(ctx, db)
if _, err := db.ExecContext(ctx, "SET @@dolt_allow_commit_conflicts = 1"); err != nil {
return fmt.Errorf("set dolt_allow_commit_conflicts: %w", err)
}
if _, err := db.ExecContext(ctx, "SET @@dolt_force_transaction_commit = 1"); err != nil {
return fmt.Errorf("set dolt_force_transaction_commit: %w", err)
}
_, mergeErr := db.ExecContext(ctx, "CALL DOLT_MERGE(?)", ref)
if mergeErr != nil && strings.Contains(mergeErr.Error(), "up to date") {
// DOLT_PULL swallows "Already up to date." internally; we do the same.
mergeErr = nil
}
return SettleMerge(ctx, db, mergeErr, preMergeClean, strategy)
}
// MergeConflictsError reports the conflicts a settle pass refused to
// auto-resolve. By the time the caller sees it the merge has been aborted (or
// the transaction rolled back) and the working set restored, so the conflicts
// are no longer queryable from dolt_conflicts — they were captured before the
// abort precisely so callers with a conflict-reporting contract (PullFrom) can
// still surface them (bd-578h9.15). Unwrap returns the merge statement's own
// error, when there was one.
type MergeConflictsError struct {View on GitHub (pinned to 71377f2769)
Solutions
- Verify the Dolt engine supports @@dolt_force_transaction_commit; upgrade if not
- Check the session is a single pinned connection whose state persists to the merge call
- Inspect the wrapped error: 'Unknown system variable' means version mismatch; connection errors mean retry/reconnect
- Ensure no earlier statement in the session poisoned the connection
Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := db.ExecContext(ctx, "SET @@dolt_force_transaction_commit = 1"); err != nil {
return fmt.Errorf("Dolt engine lacks force_transaction_commit (upgrade required): %w", err)
} Type guard
func isUnknownVariable(err error) bool { return strings.Contains(err.Error(), "Unknown system variable") || strings.Contains(err.Error(), "1193") } Try / catch
err := versioncontrolops.MergeAndSettle(ctx, db, ref)
if err != nil {
if isUnknownVariable(err) {
return fmt.Errorf("upgrade Dolt to a version supporting dolt_force_transaction_commit: %w", err)
}
return fmt.Errorf("merge settle failed: %w", err)
} Prevention
- Keep all clones on a bd/Dolt version that supports the force-commit flag
- Test session-variable support as part of the pull pre-flight
- Hold the merge on a single pinned connection
- Treat 'Unknown system variable' errors as version-skew signals, not bugs
When it happens
Trigger: Calling MergeAndSettle/MergeAndSettleWithStrategy on a Dolt version without dolt_force_transaction_commit; broken/closed connection; context deadline hit between the two SETs.
Common situations: Mixed-version Dolt deployments where one clone's engine predates the force-commit flag; connections killed by an idle proxy mid-pull.
Related errors
- set dolt_allow_commit_conflicts: %w
- failed to commit pending changes before pull: %w
- merge failed: %w
- pull merge left constraint violations bd cannot auto-repair;
- merge succeeded but is_blocked recompute failed: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/ef8acdde8963c0fc.
Report an issue: GitHub.