Schema conflict resolution needs to account for data merging
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
When merging a table, Dolt will first calculate the schema merge and then calculate the data merge. If there are schema conflicts detected those will be returned and the merge code won't process the data merge. This means that using the automated commands for resolving schema conflicts (e.g. `dolt conflicts resolve --theirs .`) will resolve the schema conflict correctly, but will resolve the table data to the same contents as either `--theirs` or `--ours`. Instead, the data should be merged and only any data conflicts should be resolved to the selected side of the merge. Issue https://github.com/dolthub/dolt/issues/6612 provides a good, concrete example of the current behavior.
We first need to define the desired workflow for this scenario and target how the user interaction should work. It would be ideal if we could calculate schema merge AND data merge in the same pass, but we can't accurately merge data until we know the final schema, so any schema conflicts must be resolved first. We can follow Git's example with something like `dolt merge --continue`.
In the meantime, as a workaround, if customers **only** have schema changes on one side of the merge and know that the data is otherwise identical on both sides of the merge, then the `dolt conflicts resolve [--theirs|--ours] .` command will work as expected. If there are only data conflicts, then the it will also work as expected. If there are schema conflicts and the table data is NOT identical, then the schema conflicts should be manually resolved by manually applying the desired schema changes to the other side of the branch, and then performing a merge to merge over the data changes. Note that this is only an issue with schema conflicts – schema changes that can be automatically merged do not have this issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the concrete schema-and-data merge case described in issue #6612, then trace the `dolt merge` and `dolt conflicts resolve --theirs|--ours` workflow. The desired interaction is still to be defined; done should preserve the data merge and limit side selection to remaining data conflicts after schema conflicts are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100