Rebase: a field update of a row deleted in the database is dropped without any record; and the conflicts file is per project, not per connection
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by tracing pull() and the rebase handling described in the issue, especially _handle_delete, then inspect how conflict and base2our/base2their filenames are built. Reproduce the delete-versus-update case and a cycle with multiple connections. Done means lost field updates are recorded and each connection's conflict and rebase files retain distinct names.
Written by the indexing model from the issue text.
Description
We ran the concurrent-edit cases of a two-way setup (db-sync 2.4.0,
geodiff 2.3.0, PostgreSQL driver, one GeoPackage, edits in the database
by SQL and in the field through the QGIS plugin, the daemon paused to
create the window). Outcomes:
| database | field | result | record |
|---|---|---|---|
| update column B | update column A, same row | both values on both sides | — |
| update value D | update same column, value F | D on both sides (the database syncs last and wins) | conflicts file, old = F, new = D |
| update row | delete row | row gone on both sides, the update dropped | conflicts file (entry without old) |
| delete row | update row | row gone on both sides, the field's update lost | nothing |
Two things we would like to change:
-
The last case leaves no record.
geodiff rebase-dbkeeps our
delete over their update (consistent with "a delete wins", fine) but
writes nothing to the conflicts file for it, so the field crew's edit
disappears without a trace: not in the database, not in the file, not
in the log. The information is available inpull()before the
rebase:base2our(computed beforemc.pull_project) holds our
delete,base2their(computed after) holds their update. Matching the
two by row key and logging one WARNING per lost update is a small
change in db-sync; PR follows. Recording it in the conflicts file
instead would be a geodiff change (the rebase's_handle_delete
records only the opposite direction), which we can propose there if
you prefer. -
The conflicts file is named per project:
<tmp>/<project name>-dbsync-pull-conflicts. With several connections
(several GeoPackages of one project, which 2.4.0 supports with one
working directory per connection), a second rebase in the same cycle
overwrites the first connection's file before anyone can read it.
Naming it<project name>-<modified schema>-dbsync-pull-conflicts,
like the working directory, keeps every connection's record. We read
these files (dbsync-manager keeps them and shows them per project), so
the name matters to us; the same goes for-dbsync-pull-base2our/
-base2their.
- Dominant language
- Python
- Stars
- 55
- Forks
- 25
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/db-sync
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/db-sync#184 ·
-
SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cyclesPossibly taken @NicklasBlidmo claimed this 23 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 52/100
MerginMaps/db-sync#193 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
MerginMaps/db-sync#185 · 1 comment ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometriesOpen
Difficulty 4/5 3-5 days Newbie friendliness 42/100
MerginMaps/db-sync#182 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
MerginMaps/db-sync#181 · 2 comments ·
All issues in MerginMaps/db-sync
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Deltares/numba_celltree#100 · 1 comment ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
soup airgap-bundle --bundle-size-cap nan, inf or a cap above ~1.67e299 GiB stops with an internal ValueError/OverflowError (exit 1) instead of a usage errorPossibly taken @Keshemir claimed this today. Openbug claimed difficulty:2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MakazhanAlpamys/Soup#3045 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dagster-io/skills#80 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day