krishvishal commented on code in PR #4073:
URL: https://github.com/apache/iggy/pull/4073#discussion_r3957099420


##########
core/simulator/src/lib.rs:
##########
@@ -930,6 +955,19 @@ impl Simulator {
             }
             for shard in &replica.shards {
                 let pending = shard.inbox_len();
+                // A fenced pump has exited, so its frames pile up exactly as a
+                // missed wake does. Reported apart: the fix is a failed 
commit,
+                // not a channel bug.
+                assert!(
+                    pending == 0 || shard.fenced_partition_fault().is_none(),

Review Comment:
   Fixed. The fenced assert is unconditional and runs first, before any lane is 
read.



##########
core/simulator/src/lib.rs:
##########
@@ -930,6 +955,19 @@ impl Simulator {
             }
             for shard in &replica.shards {
                 let pending = shard.inbox_len();
+                // A fenced pump has exited, so its frames pile up exactly as a
+                // missed wake does. Reported apart: the fix is a failed 
commit,
+                // not a channel bug.
+                assert!(
+                    pending == 0 || shard.fenced_partition_fault().is_none(),
+                    "fenced pump: replica {replica_id} shard {} holds 
{pending} frame(s) at \
+                     quiescence because its pump exited on a fatal commit 
({:?}). Not a lost \
+                     wakeup; fix the commit failure (seed {:#x}, schedule hash 
{:#x})",
+                    shard.id,
+                    shard.fenced_partition_fault(),

Review Comment:
   Fixed by the same move. The fenced assert now precedes the reply-lane and 
redispatch asserts, so a fenced pump cannot reach them.



##########
core/simulator/src/workload/invariants.rs:
##########
@@ -102,6 +141,91 @@ impl Invariants {
         self.state_checker.check(sim, seed);
     }
 
+    /// Catch a metadata primary permanently shut behind its own recovery 
barrier.
+    ///
+    /// The shape `VsrConsensus::redecide_recovery_barrier` fixes, caught from 
the
+    /// outside: a primary that can never clear its barrier drops every 
request as
+    /// `NotReady`, which otherwise surfaces only as an unexplained stall.
+    ///
+    /// # Panics
+    /// When a `Normal` metadata primary sits below its barrier for
+    /// [`RECOVERY_BARRIER_WEDGE_TICKS`] consecutive ticks.
+    fn check_recovery_barrier(&mut self, sim: &Simulator, seed: u64, 
replica_idx: u8) {
+        let Some(consensus) = sim.replicas[usize::from(replica_idx)].shards[0]
+            .plane
+            .metadata()
+            .consensus
+            .as_ref()
+        else {
+            return;
+        };
+        let gated = consensus.is_primary()

Review Comment:
   Fixed. Predicate mirrors `is_caught_up_primary`, `!is_transferring()` 
included.



##########
core/consensus/src/plane_helpers.rs:
##########
@@ -1995,6 +2041,8 @@ mod tests {
     fn drains_only_up_to_commit_frontier_even_without_quorum_flags() {

Review Comment:
   Fixed. `given_a_hole_below_the_head_when_committing_should_hold_both_gates` 
and `given_an_applied_head_when_committing_should_refuse_it` cover both arms on 
both gates.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to