From df924caeede4fa72976958654561df4e36ffa21b Mon Sep 17 00:00:00 2001 From: secwall Date: Thu, 16 Apr 2026 16:26:13 +0200 Subject: [PATCH] Properly propagate zk errors in request retry --- internal/dcs/zk.go | 4 ++-- tests/features/CLI.feature | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/dcs/zk.go b/internal/dcs/zk.go index 1286f7dd..dfb0574d 100644 --- a/internal/dcs/zk.go +++ b/internal/dcs/zk.go @@ -274,10 +274,10 @@ func (z *zkDCS) Initialize() { func (z *zkDCS) retryRequestInternal(code func() error) error { err := code() if err != zk.ErrConnectionClosed { - return nil + return backoff.Permanent(err) } if !z.IsConnected() { - return nil + return backoff.Permanent(err) } return err } diff --git a/tests/features/CLI.feature b/tests/features/CLI.feature index 55e9953e..4fea9637 100644 --- a/tests/features/CLI.feature +++ b/tests/features/CLI.feature @@ -100,7 +100,11 @@ Feature: CLI Then command return code should be "2" And command output should match regexp """ - .*replica can be set cascade.*[[:space:]].*node already has priority 5 set.* + .*replica can be set cascade.* + """ + And command output should match regexp + """ + .*node already has priority 5 set.* """ When I run command on host "mysql3" """ @@ -114,7 +118,11 @@ Feature: CLI Then command return code should be "1" And command output should match regexp """ - .*node is already streaming from mysql3[[:space:]].*node mysql2 is not HA node, priority cannot be set.* + .*node is already streaming from mysql3.* + """ + And command output should match regexp + """ + .*node mysql2 is not HA node, priority cannot be set.* """ Then zookeeper node "/test/cascade_nodes/mysql2" should exist within "5" seconds When I run command on host "mysql3"