70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
+
+
+
+
+
+
+
|
## Backports from Fossil
This list is for potential backports from fossil which should be investigated more closely to determine whether they need to be adapted for use in this library:
- Improved diff output with `--from BRANCH` when it names a branch which was just merged into the local checkout: <s>[](fossil:edb3a3a06369c1e7bd29)</s>
[](fossil:960c9e8bd69531eb)
# `fsl_cx` "id bag" caches can hypothetically get out of sync
Discovered 2021-11-18: A hypothetical problem which has not yet appeared but can potential do so in the face of a long-running app which performs "just the right" rollbacks between non-rolled-back operations...
Each fossil context object (`fsl_cx`) stores several `fsl_id_bag` objects which keep track of various RIDs for caching and fast-tracking purposes. It is hypothetically possible, in a long-running application (as opposed to the various `f-apps`) that those caches may pick up RIDs which have since been rolled back and thus are no longer in the database. That in itself is harmless, but future db ops may re-inject those same RIDs, leading to semantic mismatches between the caches and the in-db records.
On solution would be to store a copy of each such cache at the start of each transaction and revert its contents if a transaction rolls back. The minor catch with that is that the db layer doesn't "really" know about `fsl_cx` state (it does a little but, but that's unfortunate) and doesn't currently have a way to communicate to the `fsl_cx` that a transaction has finished. Another solution, though heavier, would be to abstract all access to those caches via internal APIs and use two ID bags for each cache: one for use while a transaction is active and one for state which has survived a transaction (or run without one). When a transaction rolls back, clear the "staging" bags and when one commits, move those records into the long-term bags.
# Crosslinking...
2021-04-12: The issue described below may have been resolved by the bug fixed in [](2791e665cca2eae2).
Running `f-parseparty -t c --crosslink` generates the expected number of mlink/plink entries but *sometimes* leaves (as it were) some commit other than the tip marked as a leaf, which causes `fossil update` to warn about having multiple leaves. We can get around this by running `fsl_repo_leaves_rebuild()` after it crosslinks everything, but that would simply hide the bug (if it *is* a bug - see below), which would presumably appear again at some point after a single checkin gets processed.
|