Skip to content

Fix issue with gpkg reconstruction from merged diffs#605

Open
varmar05 wants to merge 1 commit intodevelopfrom
fix_construct_checkpoint
Open

Fix issue with gpkg reconstruction from merged diffs#605
varmar05 wants to merge 1 commit intodevelopfrom
fix_construct_checkpoint

Conversation

@varmar05
Copy link
Copy Markdown
Collaborator

The issue:

In certain cases full gpkg file could not be reconstructed from diff checkpoints as those were incorrect.
Typically it happened when diff checkpoint started at version of basefile (e.g. v1) and during its construction from lower ranks starting diff was ignored leading to invalid checkpoint file.

Imagine situation like this when we wanted to create some higher rank checkpoint:

Checkpoint(rank=2, index=1, versions=v1-v16), 
[
Checkpoint(rank=1, index=1, versions=v1-v4), <-- was not created in recursion!
Checkpoint(rank=1, index=2, versions=v5-v8), 
Checkpoint(rank=1, index=3, versions=v9-v12), 	
Checkpoint(rank=0, index=13, versions=v13-v13), 
Checkpoint(rank=0, index=14, versions=v14-v14), 
Checkpoint(rank=0, index=15, versions=v15-v15) 
Checkpoint(rank=0, index=16, versions=v16-v16)
]

where first checkpoint in the list was originally ignored.

Fix:

This PR lessens the condition when checkpoint should be ignored only to situation if it spanned over basefile version.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23799172936

Details

  • 22 of 22 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 93.241%

Files with Coverage Reduction New Missed Lines %
server/mergin/sync/models.py 1 93.92%
Totals Coverage Status
Change from base Build 23786864973: 0.003%
Covered Lines: 9133
Relevant Lines: 9795

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants