dolt icon indicating copy to clipboard operation
dolt copied to clipboard

dolt_rebase('--continue') error mentions dolt_conflicts_<table> even when no conflict rows persist after abort

Open timsehn opened this issue 7 months ago • 1 comments

Problem

In an interactive rebase conflict flow, dolt_rebase('--continue') errors with guidance to resolve conflicts in dolt_conflicts_<table> and then continue rebasing.

But in the tested scenario, the rebase aborts immediately and does not leave persisted conflict rows behind, so that guidance appears incorrect or at least misleading.

Repro

CREATE TABLE t(id INT PRIMARY KEY, v INT);
INSERT INTO t VALUES(1, 10), (2, 20);
CALL dolt_add('-A');
CALL dolt_commit('-m', 'c1');

CALL dolt_checkout('-b', 'feature');
UPDATE t SET v=200 WHERE id=1;
UPDATE t SET v=201 WHERE id=2;
CALL dolt_add('-A');
CALL dolt_commit('-m', 'feat_update');

CALL dolt_checkout('main');
UPDATE t SET v=300 WHERE id=1;
UPDATE t SET v=301 WHERE id=2;
CALL dolt_add('-A');
CALL dolt_commit('-m', 'main_update');

CALL dolt_checkout('feature');
CALL dolt_rebase('-i', 'main');
CALL dolt_rebase('--continue');

Actual behavior

dolt_rebase('--continue') errors with text like:

data conflict detected while rebasing commit ... Resolve the conflicts and remove them from the dolt_conflicts_ tables, then continue the rebase by calling dolt_rebase('--continue')

But after the abort:

SELECT count(*) FROM dolt_conflicts;

returns 0, and there is no persisted conflict-table state left to resolve.

Expected behavior

Either:

  1. preserve conflict rows so the user can actually resolve them and continue, or
  2. change the error message to reflect that the rebase was aborted and there is no conflict-table state to resolve

timsehn avatar Apr 27 '26 21:04 timsehn

I tried to reproduce this against current main (d95653646-era HEAD, built locally) using the exact script from the description, run in a single dolt sql session. The misleading dolt_conflicts_<table> guidance no longer appears — dolt_rebase('--continue') now errors with:

data conflicts from rebase, but session settings do not allow preserving conflicts, so they cannot
be resolved. The rebase has been aborted. Set @@autocommit to 0 or set @@dolt_allow_commit_conflicts
to 1 and try the rebase again to resolve the conflicts.

which is expected-behavior option 2 from the description: the message reflects the abort and tells you how to retry in a mode where conflicts can actually be resolved. Post-abort state checks out too: select count(*) from dolt_conflicts returns 0, dolt_rebase doesn't exist, and the session is back on feature.

The abort path is handled in validateConflictsCanBeResolved (dolt_rebase.go), which returns ErrRebaseDataConflictsCantBeResolved when @@autocommit=1 and @@dolt_allow_commit_conflicts=0. I opened a small PR pinning the post-abort state in the existing enginetest so the message stays truthful. Likely this issue can be closed.

shaurya703 avatar Aug 08 '26 09:08 shaurya703