changeset 3966:ea7687a9a4b8 stable

obshashrange: force saving of stablesort and firstmerge cache For some reason the check in repo is not working for stable sort. We also force firstmerge to be saved as test show it was missing.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 17 Aug 2018 16:26:44 +0200
parents d4ae0e3ec743
children d54925819f34 d081528bb372
files CHANGELOG hgext3rd/evolve/stablerangecache.py tests/test-discovery-obshashrange-cache.t tests/test-discovery-obshashrange.t
diffstat 4 files changed, 23 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Fri Aug 17 13:31:35 2018 +0200
+++ b/CHANGELOG	Fri Aug 17 16:26:44 2018 +0200
@@ -7,6 +7,7 @@
   * next: fix topic restriction when passing --evolve
   * clone: fix possible crash when using clone bundle and forcing cache warming
   * obshashrange: fix speed and consistency issues during cache invalidation
+  * obshashrange: properly persist all caches involved in obshashrange discovery
 
 8.1.0 -- 2018-08-03
 -------------------
--- a/hgext3rd/evolve/stablerangecache.py	Fri Aug 17 13:31:35 2018 +0200
+++ b/hgext3rd/evolve/stablerangecache.py	Fri Aug 17 16:26:44 2018 +0200
@@ -225,8 +225,8 @@
     def _save(self, repo):
         repo = repo.unfiltered()
         repo.depthcache.save(repo)
-        if 'stablesort' in vars(repo):
-            repo.stablesort.save(repo)
+        repo.stablesort.save(repo)
+        repo.firstmergecache.save(repo)
         if not self._unsavedsubranges:
             return # no new data
 
--- a/tests/test-discovery-obshashrange-cache.t	Fri Aug 17 13:31:35 2018 +0200
+++ b/tests/test-discovery-obshashrange-cache.t	Fri Aug 17 16:26:44 2018 +0200
@@ -88,7 +88,9 @@
 
   $ f -s main/.hg/cache/evoext*
   main/.hg/cache/evoext-depthcache-00: size=88
+  main/.hg/cache/evoext-firstmerge-00: size=88
   main/.hg/cache/evoext-obscache-00: size=72
+  main/.hg/cache/evoext-stablesortcache-00: size=92
   main/.hg/cache/evoext_obshashrange_v2.sqlite: size=?* (glob)
   main/.hg/cache/evoext_stablerange_v2.sqlite: size=?* (glob)
 
@@ -132,7 +134,9 @@
 
   $ f -s main/.hg/cache/evoext*
   main/.hg/cache/evoext-depthcache-00: size=88
+  main/.hg/cache/evoext-firstmerge-00: size=88
   main/.hg/cache/evoext-obscache-00: size=72
+  main/.hg/cache/evoext-stablesortcache-00: size=92
   main/.hg/cache/evoext_obshashrange_v2.sqlite: size=?* (glob)
   main/.hg/cache/evoext_stablerange_v2.sqlite: size=?* (glob)
 
@@ -158,6 +162,8 @@
 
   $ f -s main/.hg/cache/evoext*
   main/.hg/cache/evoext-depthcache-00: size=88
+  main/.hg/cache/evoext-firstmerge-00: size=88
   main/.hg/cache/evoext-obscache-00: size=72
+  main/.hg/cache/evoext-stablesortcache-00: size=92
   main/.hg/cache/evoext_obshashrange_v2.sqlite: size=?* (glob)
   main/.hg/cache/evoext_stablerange_v2.sqlite: size=?* (glob)
--- a/tests/test-discovery-obshashrange.t	Fri Aug 17 13:31:35 2018 +0200
+++ b/tests/test-discovery-obshashrange.t	Fri Aug 17 16:26:44 2018 +0200
@@ -141,6 +141,10 @@
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
   1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (8r, 5o) (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablesort cache reset (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-firstmerge cache reset (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
   * @0000000000000000000000000000000000000000 (*)> debugobshashrange --subranges --rev tip exited 0 after *.?? seconds (glob)
   * @0000000000000000000000000000000000000000 (*)> -R server serve --stdio (glob)
   * @0000000000000000000000000000000000000000 (*)> -R server serve --stdio exited 0 after *.?? seconds (glob)
@@ -236,11 +240,9 @@
   remote: 1 new obsolescence markers
   $ hg -R ../server blackbox
   * @0000000000000000000000000000000000000000 (*)> -R server serve --stdio (glob)
-  * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-firstmerge cache reset (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (9r) (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (1r) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (1r) (glob)
-  * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablesort cache reset (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (9r) (glob)
+  1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (1r) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (1r) (glob)
   1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (1r, 1o) (glob)
   * @0000000000000000000000000000000000000000 (*)> obscache is out of date, falling back to slower obsstore version (glob)
@@ -344,6 +346,10 @@
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> query 0; add more sample (target 100, current 1) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> query 0; sample size is 9, largest range 5 (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> sending evoext_obshashrange_v1 command (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablesort cache reset (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablesort in *.???? seconds (6r) (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-firstmerge cache reset (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (6r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> obsdiscovery, 0/5 mismatch - 1 obshashrange queries in *.???? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> obsdiscovery, 0/5 mismatch - 1 obshashrange queries in *.???? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> checking for updated bookmarks (glob)
@@ -544,6 +550,8 @@
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (2r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> obshashcache clean - new markers affect 2 changeset and cached ranges (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-obshashrange in *.???? seconds (2r, 3o) (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablesort in *.???? seconds (2r) (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (2r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> debugobshashrange --subranges --rev 'heads(all())' exited 0 after *.?? seconds (glob) (no-windows !)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> pull -r f69452c5b1af6cbaaa56ef50cf94fff5bcc6ca23 (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> obsdiscovery, 2/7 mismatch - 1 obshashrange queries in *.???? seconds (glob)
@@ -896,10 +904,6 @@
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> 1 incoming changes - new heads: 4de32a90b66c (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> pull exited 0 after *.?? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> rollback (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-firstmerge cache reset (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablesort cache reset (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated base branch cache in *.???? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> wrote base branch cache with 1 labels and 2 nodes (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-obscache cache reset (glob)
@@ -1054,6 +1058,8 @@
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-depthcache in *.???? seconds (1r) (glob)
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (1r) (glob)
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-obshashrange in *.???? seconds (1r, 1o) (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablesort in *.???? seconds (1r) (glob)
+  1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (1r) (glob)
   1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> debugobshashrange --subranges --rev 'heads(all())' exited 0 after *.?? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> log -G (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> log -G exited 0 after *.?? seconds (glob)