summaryrefslogtreecommitdiffstats
path: root/452.patch
blob: 499bcd4ab3f2eed1116feace6130f4c2036d9e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 5921cdaad46356750e6a0cdaec474a6de55960e5 Mon Sep 17 00:00:00 2001
From: git-hulk <hulk.website@gmail.com>
Date: Sun, 23 Feb 2020 20:31:16 +0800
Subject: [PATCH] FIX: store_retry_count shouldn't be set implicitly

It's wired that store commands would be auto-retry implicitly while the default value of store_retry_count was 2, as well as the timeout, would be 3 times in those store commands which may confuse users. IMHO, the retry should be set explicitly instead of implicitly.
---
 memcached.ini   | 4 ++--
 php_memcached.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/memcached.ini b/memcached.ini
index 5ed79bdb..79c7ef7b 100644
--- a/memcached.ini
+++ b/memcached.ini
@@ -131,8 +131,8 @@
 ; This mechanism allows transparent fail-over to secondary servers when
 ; set/increment/decrement/setMulti operations fail on the desired server in a multi-server
 ; environment.
-; the default is 2
-;memcached.store_retry_count = 2
+; the default is 0
+;memcached.store_retry_count = 0
 
 ; Sets the default for consistent hashing for new connections.
 ; (To configure consistent hashing for session connections,
diff --git a/php_memcached.c b/php_memcached.c
index 50636952..272ec381 100644
--- a/php_memcached.c
+++ b/php_memcached.c
@@ -401,7 +401,7 @@ PHP_INI_BEGIN()
 	MEMC_INI_ENTRY("compression_factor",    "1.3",                   OnUpdateReal,            compression_factor)
 	MEMC_INI_ENTRY("compression_threshold", "2000",                  OnUpdateLong,            compression_threshold)
 	MEMC_INI_ENTRY("serializer",            SERIALIZER_DEFAULT_NAME, OnUpdateSerializer,      serializer_name)
-	MEMC_INI_ENTRY("store_retry_count",     "2",                     OnUpdateLong,            store_retry_count)
+	MEMC_INI_ENTRY("store_retry_count",     "0",                     OnUpdateLong,            store_retry_count)
 
 	MEMC_INI_BOOL ("default_consistent_hash",       "0", OnUpdateBool,       default_behavior.consistent_hash_enabled)
 	MEMC_INI_BOOL ("default_binary_protocol",       "0", OnUpdateBool,       default_behavior.binary_protocol_enabled)