@@ -81,13 +81,21 @@ where
81
81
if revisions. cycle_heads . contains ( & database_key_index) {
82
82
if let Some ( last_provisional) = opt_last_provisional {
83
83
if let Some ( provisional_value) = & last_provisional. value {
84
+ tracing:: debug!(
85
+ "{database_key_index:?}: execute: \
86
+ I am a cycle head, comparing last provisional value \
87
+ {provisional_value:#?} with new value {new_value:#?}"
88
+ ) ;
84
89
// If the new result is equal to the last provisional result, the cycle has
85
90
// converged and we are done.
86
91
if !C :: values_equal ( & new_value, provisional_value) {
87
92
// We are in a cycle that hasn't converged; ask the user's
88
93
// cycle-recovery function what to do:
89
94
match C :: recover_from_cycle ( db, & new_value, iteration_count) {
90
95
crate :: CycleRecoveryAction :: Iterate => {
96
+ tracing:: debug!(
97
+ "{database_key_index:?}: execute: iterate again"
98
+ ) ;
91
99
iteration_count += 1 ;
92
100
revisions. cycle_ignore = false ;
93
101
opt_last_provisional = Some ( self . insert_memo (
98
106
continue ;
99
107
}
100
108
crate :: CycleRecoveryAction :: Fallback ( fallback_value) => {
109
+ tracing:: debug!(
110
+ "{database_key_index:?}: execute: fall back to {fallback_value:#?}"
111
+ ) ;
101
112
new_value = fallback_value;
102
113
}
103
114
}
@@ -106,7 +117,7 @@ where
106
117
}
107
118
// This is no longer a provisional result, it's our final result, so remove ourself
108
119
// from the cycle heads, and iterate one last time to remove ourself from all other
109
- // results in the cycle as well.
120
+ // results in the cycle as well and turn them into usable cached results .
110
121
revisions. cycle_heads . remove ( & database_key_index) ;
111
122
revisions. cycle_ignore = false ;
112
123
self . insert_memo (
@@ -116,6 +127,9 @@ where
116
127
) ;
117
128
continue ;
118
129
}
130
+
131
+ tracing:: debug!( "{database_key_index:?}: execute: result.revisions = {revisions:#?}" ) ;
132
+
119
133
return self . insert_memo (
120
134
zalsa,
121
135
id,
0 commit comments