From a8a490b6ed97c4afe4235b6dfc88bd2d0bec947e Mon Sep 17 00:00:00 2001 From: PachKosti Date: Thu, 6 Feb 2020 18:15:05 +0100 Subject: [PATCH 1/3] fix checksum issue --- mergin/client.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/mergin/client.py b/mergin/client.py index db667974..b44872b8 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -165,6 +165,9 @@ def inspect_files(self): for file in files: if self.ignore_file(file): continue + if "gpkg" in file: + do_sqlite_checkpoint(os.path.join(root, file)) + abs_path = os.path.abspath(os.path.join(root, file)) rel_path = os.path.relpath(abs_path, start=self.dir) proj_path = '/'.join(rel_path.split(os.path.sep)) # we need posix path @@ -298,6 +301,12 @@ def get_push_changes(self): :rtype: dict """ changes = self.compare_file_sets(self.metadata['files'], self.inspect_files()) + # do checkpoint to push changes from wal file to gpkg if new file + for file in changes['added']: + if ".gpkg" in file["path"]: + do_sqlite_checkpoint(self.fpath(file["path"])) + file["checksum"] = generate_checksum(self.fpath(file["path"])) + for file in changes['added'] + changes['updated']: file['chunks'] = [str(uuid.uuid4()) for i in range(math.ceil(file["size"] / UPLOAD_CHUNK_SIZE))] @@ -332,7 +341,11 @@ def get_push_changes(self): else: not_updated.append(file) except (pygeodiff.GeoDiffLibError, pygeodiff.GeoDiffLibConflictError) as e: - pass # we do force update + # do checkpoint to push changes from wal file to gpkg if create changeset failed + do_sqlite_checkpoint(self.fpath(file["path"])) + file["checksum"] = generate_checksum(self.fpath(file["path"])) + file["size"] = os.path.getsize(self.fpath(file["path"])) + file['chunks'] = [str(uuid.uuid4()) for i in range(math.ceil(file["size"] / UPLOAD_CHUNK_SIZE))] changes['updated'] = [f for f in changes['updated'] if f not in not_updated] return changes @@ -944,10 +957,6 @@ def _push_changes(self, mp, data, parallel): with concurrent.futures.ThreadPoolExecutor() as executor: futures_map = {} for file in upload_files: - # do checkpoint to push changes from wal file to gpkg if there is no diff - if "diff" not in file and mp.is_versioned_file(file["path"]): - do_sqlite_checkpoint(mp.fpath(file["path"])) - file["checksum"] = generate_checksum(mp.fpath(file["path"])) file['location'] = mp.fpath_meta(file['diff']['path']) if 'diff' in file else mp.fpath(file['path']) future = executor.submit(self._upload_file, info["transaction"], file, parallel) futures_map[future] = file @@ -960,10 +969,6 @@ def _push_changes(self, mp, data, parallel): raise ClientError("Timeout error: failed to upload {}".format(file)) else: for file in upload_files: - # do checkpoint to push changes from wal file to gpkg if there is no diff - if "diff" not in file and mp.is_versioned_file(file["path"]): - do_sqlite_checkpoint(mp.fpath(file["path"])) - file["checksum"] = generate_checksum(mp.fpath(file["path"])) file['location'] = mp.fpath_meta(file['diff']['path']) if 'diff' in file else mp.fpath(file['path']) self._upload_file(info["transaction"], file, parallel) From a1cbc89b7a50ffd8b2fe54ff91ce8bbfd3a22e22 Mon Sep 17 00:00:00 2001 From: Martin Varga Date: Mon, 10 Feb 2020 16:18:08 +0100 Subject: [PATCH 2/3] for gpkg files (added, updated) commit changes from wal file before starting upload transaction --- mergin/client.py | 62 +++++++++++------- mergin/test/modified_schema/base.gpkg-wal | Bin 32992 -> 0 bytes .../{base.gpkg => modified_schema.gpkg} | Bin 98304 -> 98304 bytes ...base.gpkg-shm => modified_schema.gpkg-shm} | Bin 32768 -> 32768 bytes .../modified_schema/modified_schema.gpkg-wal | Bin 0 -> 8272 bytes mergin/test/test_client.py | 36 ++++++++-- mergin/utils.py | 13 +++- 7 files changed, 81 insertions(+), 30 deletions(-) delete mode 100644 mergin/test/modified_schema/base.gpkg-wal rename mergin/test/modified_schema/{base.gpkg => modified_schema.gpkg} (99%) rename mergin/test/modified_schema/{base.gpkg-shm => modified_schema.gpkg-shm} (98%) create mode 100644 mergin/test/modified_schema/modified_schema.gpkg-wal diff --git a/mergin/client.py b/mergin/client.py index b44872b8..ee34b65a 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -134,6 +134,22 @@ def is_versioned_file(self, file): f_extension = os.path.splitext(file)[1] return f_extension in diff_extensions + def is_gpkg_open(self, path): + """ + Check whether geopackage file is open (and wal file exists) + + :param path: absolute path of file on disk + :type path: str + :returns: whether file is open + :rtype: bool + """ + f_extension = os.path.splitext(path)[1] + if f_extension != '.gpkg': + return False + if os.path.exists(f'{path}-wal') and os.path.exists(f'{path}-shm'): + return True + return False + def ignore_file(self, file): """ Helper function for blacklisting certain types of files. @@ -165,8 +181,6 @@ def inspect_files(self): for file in files: if self.ignore_file(file): continue - if "gpkg" in file: - do_sqlite_checkpoint(os.path.join(root, file)) abs_path = os.path.abspath(os.path.join(root, file)) rel_path = os.path.relpath(abs_path, start=self.dir) @@ -225,7 +239,8 @@ def compare_file_sets(self, origin, current): path = f["path"] if path not in origin_map: continue - if f["checksum"] == origin_map[path]["checksum"]: + # with open WAL files we don't know yet, better to mark file as updated + if not self.is_gpkg_open(self.fpath(path)) and f["checksum"] == origin_map[path]["checksum"]: continue f["origin_checksum"] = origin_map[path]["checksum"] updated.append(f) @@ -301,13 +316,12 @@ def get_push_changes(self): :rtype: dict """ changes = self.compare_file_sets(self.metadata['files'], self.inspect_files()) - # do checkpoint to push changes from wal file to gpkg if new file - for file in changes['added']: - if ".gpkg" in file["path"]: - do_sqlite_checkpoint(self.fpath(file["path"])) - file["checksum"] = generate_checksum(self.fpath(file["path"])) - + # do checkpoint to push changes from wal file to gpkg for file in changes['added'] + changes['updated']: + size, checksum = do_sqlite_checkpoint(self.fpath(file["path"])) + if size and checksum: + file["size"] = size + file["checksum"] = checksum file['chunks'] = [str(uuid.uuid4()) for i in range(math.ceil(file["size"] / UPLOAD_CHUNK_SIZE))] if not self.geodiff: @@ -320,8 +334,9 @@ def get_push_changes(self): if not self.is_versioned_file(path): continue + # we use geodiff to check if we can push only diff files current_file = self.fpath(path) - origin_file = self.fpath(path, self.meta_dir) + origin_file = self.fpath_meta(path) diff_id = str(uuid.uuid4()) diff_name = path + '-diff-' + diff_id diff_file = self.fpath_meta(diff_name) @@ -341,11 +356,8 @@ def get_push_changes(self): else: not_updated.append(file) except (pygeodiff.GeoDiffLibError, pygeodiff.GeoDiffLibConflictError) as e: - # do checkpoint to push changes from wal file to gpkg if create changeset failed - do_sqlite_checkpoint(self.fpath(file["path"])) - file["checksum"] = generate_checksum(self.fpath(file["path"])) - file["size"] = os.path.getsize(self.fpath(file["path"])) - file['chunks'] = [str(uuid.uuid4()) for i in range(math.ceil(file["size"] / UPLOAD_CHUNK_SIZE))] + # changes from wal file already committed + pass changes['updated'] = [f for f in changes['updated'] if f not in not_updated] return changes @@ -490,15 +502,16 @@ def apply_push_changes(self, changes): elif k == 'added': shutil.copy(self.fpath(path), basefile) elif k == 'updated': - # in case for geopackage cannot be created diff + # in case for geopackage cannot be created diff (e.g. forced update with committed changes from wal file) if "diff" not in item: - continue - # better to apply diff to previous basefile to avoid issues with geodiff tmp files - changeset = self.fpath_meta(item['diff']['path']) - patch_error = self.apply_diffs(basefile, [changeset]) - if patch_error: - # in case of local sync issues it is safier to remove basefile, next time it will be downloaded from server - os.remove(basefile) + shutil.copy(self.fpath(path), basefile) + else: + # better to apply diff to previous basefile to avoid issues with geodiff tmp files + changeset = self.fpath_meta(item['diff']['path']) + patch_error = self.apply_diffs(basefile, [changeset]) + if patch_error: + # in case of local sync issues it is safier to remove basefile, next time it will be downloaded from server + os.remove(basefile) else: pass @@ -1090,6 +1103,7 @@ def _download_file(self, project_path, file, directory, parallel=True, diff_only } file_dir = os.path.dirname(os.path.normpath(os.path.join(directory, file['path']))) basename = os.path.basename(file['diff']['path']) if diff_only else os.path.basename(file['path']) + expected_size = file['diff']['size'] if diff_only else file['size'] if file['size'] == 0: os.makedirs(file_dir, exist_ok=True) @@ -1130,7 +1144,7 @@ def download_file_part(part): shutil.copyfileobj(chunk, final) os.remove(file_part) - if os.path.getsize(os.path.join(file_dir, basename)) != file['size']: + if os.path.getsize(os.path.join(file_dir, basename)) != expected_size: os.remove(os.path.join(file_dir, basename)) raise ClientError(f'Download of file {basename} failed. Please try it again.') diff --git a/mergin/test/modified_schema/base.gpkg-wal b/mergin/test/modified_schema/base.gpkg-wal deleted file mode 100644 index 603abafc4748f493623609f29161a0ed6df3bda9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI4e{3699l-DG#!i}~ZU?O!x~;D+k!@zTu|wJ<{WUkaBwiCcb>Ty4 z-d&oclNd?bA%qZO;}2kfKu`pefJtbPh7bYq4_YgPkf!YqkTx{6;)gU^O$9UxeDB`b zzB`|dn@mbU&&nmf_rCAl_kG^?ec$_j?e_4qj%6zNhusvlol;(Re)lEn<=0>Aef^oY z+J64;&wm1nXnpy$?4KTeKb5;Nb$VQod6X%N`IL-$p|#CMJ&F*>hT($#DzE+UZcF7( z?a%wBaz8qGYE)OQe;cL_Jos`8l-OK%l=9uK_g!~7=#Hx#d@J)0m-SSb3F3a=-~CDi$XD%l6eWu6bq6pri6k#h_q3v z!$UKvLZK+5r+Jj)B?-y1sR9al{pidX1Dg6`%$WlQ`J*W0KZ2Op@bY6W=bqDmabG=* zmx{$am*X$;Ic~0$1~tr({wu_q9x4cvlfw%CVg^-ZHV72!xE`Q76|8Xf7;);PkD?w8 z=Fx2!W=j(=*J+W}=V~@xfw{@{SXIo@8k@kkGSuO82ZQu;1L|5Z+nM>kvut>glj96B z*CL*(M&}kZtv5d0vD|LodQm=NF7qYW5H~>>))%)NDX`!X+LJ$CJu{Dk|a1MeE9;cx;LVml9)9={zUPc{G`bPDB#Z=oB-pXAsaW zF@HeUECbE*c}_=5@ov%4n7Ic(N-!hfPGUpM6vhqiNahQ&q(klZpXhYBr-C#k6w>^H zbRh>jDVLg)i|RdRo+d72F4?y7@K&e0uaCZhbu!m;5?|xTm9qAR=AcOEaTrZP4=o^x z5+|fbZ$uP~c+BXbO*`2C0jK^C$yHY77 z3#l9@@)=HAl#ovo^pCbX+)wp2J;Ol0c9xa-=(tQdo$kYj>Cfz~F8C~8%=5Ci$juaU zbNPa#PQSUZwRWz}BK0RbfP1#`43$pg#S(8NP|r3lAvPMDR#st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fBK)w(frc9oVvg~N?mL(U7DLu|87=2KRfd|^Jwu0%fDazbm?T_ zAE~z&niu{&|9#j^0EHbtV+#eQzvcpJIhLluO|IL6I@J$5mI;@}F-xz7;LVPq%;sEP z{^f5>dflVkPzKN z+b!?g7905qbDqSJiu1M@y3^h$q7PQbn%ii%1>=P!`pyQfUXdd~$jdSET(n zuV&bl6=pzCAZAMbUJjpbXu&y@#RilFFUr^CvQ&b7dm`PTLV*FJeIS7MQCVD}W!?G+ z1{PFYMmvl4#4V||=Mk9jB8pJ(1NkyZ*WkMoyn~za^^q58$a_4(V|0Qc-S@M)3elpz zKujb;2ifJTSDRo@#|nXE@+=*JaepPvUcb)NUC;GiMA+KLhnmsQBEwfgJ{4KaVV@9S GC;vZLwnml! literal 0 HcmV?d00001 diff --git a/mergin/test/test_client.py b/mergin/test/test_client.py index ef4e532c..049a4080 100644 --- a/mergin/test/test_client.py +++ b/mergin/test/test_client.py @@ -136,11 +136,6 @@ def test_push_pull_changes(mc, parallel): f_updated = 'test3.txt' with open(os.path.join(project_dir, f_updated), 'w') as f: f.write('Modified') - src_files = os.listdir(CHANGED_SCHEMA_DIR) - for file_name in src_files: - full_file_name = os.path.join(CHANGED_SCHEMA_DIR, file_name) - if os.path.isfile(full_file_name): - shutil.copy(full_file_name, project_dir) # check changes before applied pull_changes, push_changes, _ = mc.project_status(project_dir) @@ -342,3 +337,34 @@ def test_list_of_push_changes(mc): mc.project_status(project_dir) +def test_force_gpkg_update(mc): + test_project = 'test_force_update' + project = API_USER + '/' + test_project + project_dir = os.path.join(TMP_DIR, test_project) # primary project dir for updates + + cleanup(mc, project, [project_dir]) + # create remote project + shutil.copytree(TEST_DATA_DIR, project_dir) + mc.create_project(test_project, project_dir) + + # test push changes with force gpkg file upload: + mp = MerginProject(project_dir) + f_updated = 'base.gpkg' + checksum = generate_checksum(mp.fpath(f_updated)) + + # base.gpkg updated to modified_schema (inserted new column) + shutil.move(mp.fpath(f_updated), mp.fpath_meta(f_updated)) # make local copy for changeset calculation (which will fail) + shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg'), mp.fpath(f_updated)) + shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg-wal'), mp.fpath(f_updated + '-wal')) + shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg-shm'), mp.fpath(f_updated + '-shm')) + mc.push_project(project_dir) + # by this point local file has been updated (changes committed from wal) + updated_checksum = generate_checksum(mp.fpath(f_updated)) + assert checksum != updated_checksum + + # check project after push + project_info = mc.project_info(project) + assert project_info['version'] == 'v2' + f_remote = next((f for f in project_info['files'] if f['path'] == f_updated), None) + assert f_remote['checksum'] == updated_checksum + assert 'diff' not in f_remote diff --git a/mergin/utils.py b/mergin/utils.py index 29e6f52e..ddbbc126 100644 --- a/mergin/utils.py +++ b/mergin/utils.py @@ -71,8 +71,15 @@ def int_version(version): def do_sqlite_checkpoint(path): """ - function to do checkpoint over the geopackage file which was not able to do diff file + Function to do checkpoint over the geopackage file which was not able to do diff file. + + :param path: file's absolute path on disk + :type path: str + :returns: new size and checksum of file after checkpoint + :rtype: int, str """ + new_size = None + new_checksum = None if ".gpkg" in path and os.path.exists(f'{path}-wal') and os.path.exists(f'{path}-shm'): conn = sqlite3.connect(path) cursor = conn.cursor() @@ -80,3 +87,7 @@ def do_sqlite_checkpoint(path): cursor.execute("VACUUM") conn.commit() conn.close() + new_size = os.path.getsize(path) + new_checksum = generate_checksum(path) + + return new_size, new_checksum From 9d00f583bb3b0880ecb869611b284024c0bb65d1 Mon Sep 17 00:00:00 2001 From: Martin Varga Date: Mon, 10 Feb 2020 16:58:25 +0100 Subject: [PATCH 3/3] removed unnecessary use for -shm files --- mergin/client.py | 2 +- .../modified_schema/modified_schema.gpkg-shm | Bin 32768 -> 0 bytes mergin/test/test_client.py | 1 - mergin/utils.py | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 mergin/test/modified_schema/modified_schema.gpkg-shm diff --git a/mergin/client.py b/mergin/client.py index ee34b65a..a0551e0f 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -146,7 +146,7 @@ def is_gpkg_open(self, path): f_extension = os.path.splitext(path)[1] if f_extension != '.gpkg': return False - if os.path.exists(f'{path}-wal') and os.path.exists(f'{path}-shm'): + if os.path.exists(f'{path}-wal'): return True return False diff --git a/mergin/test/modified_schema/modified_schema.gpkg-shm b/mergin/test/modified_schema/modified_schema.gpkg-shm deleted file mode 100644 index 4782ad9aa2bef586e38253f68bac64e6cc9afd65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI*FA4%d6bE3n**4B4)NJ2i_8dlGo55lfJb-NR3LeO;$*SzmQ(3GwVZR?d<`2Ug z_zp0WE|WoI_^x7<$CPWoSl!0e@_F8t$5TDKuMfM&bu*u)AJ6AjuSDPGE1&Idi2I9f zWkP@e0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAkYticy&Su5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNCf9|H03o)92FfB*pk1PBlyK!5-N0{s?f0qxo- AWdHyG diff --git a/mergin/test/test_client.py b/mergin/test/test_client.py index 049a4080..0c7975c5 100644 --- a/mergin/test/test_client.py +++ b/mergin/test/test_client.py @@ -356,7 +356,6 @@ def test_force_gpkg_update(mc): shutil.move(mp.fpath(f_updated), mp.fpath_meta(f_updated)) # make local copy for changeset calculation (which will fail) shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg'), mp.fpath(f_updated)) shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg-wal'), mp.fpath(f_updated + '-wal')) - shutil.copy(os.path.join(CHANGED_SCHEMA_DIR, 'modified_schema.gpkg-shm'), mp.fpath(f_updated + '-shm')) mc.push_project(project_dir) # by this point local file has been updated (changes committed from wal) updated_checksum = generate_checksum(mp.fpath(f_updated)) diff --git a/mergin/utils.py b/mergin/utils.py index ddbbc126..f7944e66 100644 --- a/mergin/utils.py +++ b/mergin/utils.py @@ -80,7 +80,7 @@ def do_sqlite_checkpoint(path): """ new_size = None new_checksum = None - if ".gpkg" in path and os.path.exists(f'{path}-wal') and os.path.exists(f'{path}-shm'): + if ".gpkg" in path and os.path.exists(f'{path}-wal'): conn = sqlite3.connect(path) cursor = conn.cursor() cursor.execute("PRAGMA wal_checkpoint=FULL")