You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2026/08/24 07:35:32 UTC

(iggy) 04/07: fix(server): stop the refusal error text from claiming a disposition

This is an automated email from the ASF dual-hosted git repository.

hubcio pushed a commit to branch fix/torn-segment-truncate
in repository https://gitbox.apache.org/repos/asf/iggy.git

commit b2265c348ea39d781271602f6416ee6960c88161
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Mon Aug 24 09:21:50 2026 +0200

    fix(server): stop the refusal error text from claiming a disposition
    
    The PartitionRecoveryRefused Display told the operator boot moves
    the refused files into .fenced.N and rebuilds -- but since the
    single-replica path started leaving files in place and tombstoning,
    one boot logged that claim two lines away from "leaving the refused
    segment files in place". The error is rendered for every refusal via
    the recover_partition_segments error wrapper, so the wrong half
    always showed.
    
    Disposition is decided by the bootstrap arms that catch the error
    and only they know which branch ran, so the Display now states the
    refusal alone and the arms own the disposition text. The tombstone
    line also carries the refusal reason now: it is the line an operator
    greps to enumerate dark partitions, so it must stand on its own.
---
 core/server/src/bootstrap.rs    |  4 ++++
 core/server/src/server_error.rs | 12 +++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/core/server/src/bootstrap.rs b/core/server/src/bootstrap.rs
index 5044480e2..d3ccedddd 100644
--- a/core/server/src/bootstrap.rs
+++ b/core/server/src/bootstrap.rs
@@ -1968,11 +1968,15 @@ async fn build_shard_for_thread(
                     // unless the length diverges again, accepts the chain
                     // instead of re-tombstoning -- acceptable for an
                     // assertion that the filesystem lied about a length.
+                    // `%reason` repeated on purpose: this is the line an
+                    // operator greps to enumerate dark partitions, so it has
+                    // to carry the verdict on its own.
                     error!(
                         stream_id,
                         topic_id,
                         partition_id = partition_metadata.id,
                         partition_dir,
+                        %reason,
                         "no peer replica holds this partition's data; leaving the refused \
                          segment files in place and tombstoning it instead of serving it \
                          empty"
diff --git a/core/server/src/server_error.rs b/core/server/src/server_error.rs
index a1c03e679..93048d958 100644
--- a/core/server/src/server_error.rs
+++ b/core/server/src/server_error.rs
@@ -169,13 +169,15 @@ pub enum ServerError {
     // failures (stat, open, read, truncate, fsync) stay node-fatal on purpose:
     // a retried boot can still serve that partition, while fencing it would
     // quarantine healthy data.
+    //
+    // The Display text deliberately claims nothing about what happens to the
+    // refused files: disposition (quarantine into `.fenced.N` vs tombstone
+    // with files left in place) is decided by the `bootstrap.rs` arms that
+    // catch this error, and only they log it -- a claim here would render
+    // beside theirs and contradict one branch or the other.
     #[error(
         "partition {stream_id}/{topic_id}/{partition_id} at {dir} refused segment \
-         recovery: {reason}. Boot moves the partition's segment files into a \
-         sibling `<partition dir>.fenced.N` directory and keeps them; with peer \
-         replicas the partition is rebuilt empty and refilled by state transfer, \
-         while with replica_count = 1 (or when the quarantine itself fails) it \
-         is tombstoned and not served"
+         recovery: {reason}"
     )]
     PartitionRecoveryRefused {
         dir: PathBuf,