{"id":34364,"date":"2022-11-06T06:34:02","date_gmt":"2023-01-09T03:34:12","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/"},"modified":"2024-04-28T23:17:27","modified_gmt":"2024-04-28T15:17:27","slug":"%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/","title":{"rendered":"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch"},"content":{"rendered":"<p>\u6211\u60f3\u8981\u4e86\u89e3Redis\u7684\u590d\u5236\u529f\u80fd\u5728\u505a\u4ec0\u4e48\uff0c\u6240\u4ee5\u8fb9\u9605\u8bfb\u6e90\u4ee3\u7801\u8fb9\u7ffb\u8bd1\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gh\">diff --git a\/src\/replication.c b\/src\/replication.c\r\nindex 9c1e1f0..b9812e7 100644\r\n<\/span><span class=\"gd\">--- a\/src\/replication.c\r\n<\/span><span class=\"gi\">+++ b\/src\/replication.c\r\n<\/span><span class=\"p\">@@ -412,20 +412,20 @@<\/span> need_full_resync:\r\n\r\n \/* SYNC ad PSYNC command implemenation. *\/\r\n void syncCommand(redisClient *c) {\r\n<span class=\"gd\">-    \/* ignore SYNC if already slave or in monitor mode *\/\r\n<\/span><span class=\"gi\">+    \/* \u3059\u3067\u306b\u30b9\u30ec\u30fc\u30d6\u307e\u305f\u306f\u30e2\u30cb\u30bf\u30e2\u30fc\u30c9\u306e\u5834\u5408\u306b\u306f\u3001SYNC\u3092\u7121\u8996\u3057\u307e\u3059\u3002 *\/\r\n<\/span>     if (c-&gt;flags &amp; REDIS_SLAVE) return;\r\n\r\n-    \/* Refuse SYNC requests if we are a slave but the link with our master\r\n<span class=\"gd\">-     * is not ok... *\/\r\n<\/span><span class=\"gi\">+    \/* \u3053\u306e\u30b5\u30fc\u30d0\u304c\u30b9\u30ec\u30fc\u30d6\u3067\u3001\u30de\u30b9\u30bf\u30fc\u3068\u306e\u30ea\u30f3\u30af\u304c\u51fa\u6765\u306a\u3044\u5834\u5408\u306f\u3001\r\n+     * SYNC\u306e\u8981\u6c42\u3092\u62d2\u5426\u3057\u307e\u3059\u3002*\/\r\n<\/span>     if (server.masterhost &amp;&amp; server.repl_state != REDIS_REPL_CONNECTED) {\r\n         addReplyError(c,\"Can't SYNC while not connected with my master\");\r\n         return;\r\n     }\r\n\r\n-    \/* SYNC can't be issued when the server has pending data to send to\r\n<span class=\"gd\">-     * the client about already issued commands. We need a fresh reply\r\n-     * buffer registering the differences between the BGSAVE and the current\r\n-     * dataset, so that we can copy to other slaves if needed. *\/\r\n<\/span><span class=\"gi\">+    \/* \u30b5\u30fc\u30d0\u304c\u65e2\u306b\u767a\u884c\u3057\u305f\u30b3\u30de\u30f3\u30c9\u5185\u306b\u3001\u9001\u4fe1\u304c\u4fdd\u7559\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408\u306f\r\n+     * SYNC\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u4ed6\u306e\u30b9\u30ec\u30fc\u30d6\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\r\n+     * \u3088\u3046\u306b\u3001BGSAVE\u3068\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u9055\u3044\u3092\u3001\u65b0\u3057\u3044\u30ea\u30d7\u30e9\u30a4\u30d0\u30c3\u30d5\u30a1\u306b\r\n+     * \u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002*\/\r\n<\/span>     if (listLength(c-&gt;reply) != 0 || c-&gt;bufpos != 0) {\r\n         addReplyError(c,\"SYNC and PSYNC are invalid with pending output\");\r\n         return;\r\n<span class=\"p\">@@ -433,44 +433,40 @@<\/span> void syncCommand(redisClient *c) {\r\n\r\n     redisLog(REDIS_NOTICE,\"Slave asks for synchronization\");\r\n\r\n-    \/* Try a partial resynchronization if this is a PSYNC command.\r\n<span class=\"gd\">-     * If it fails, we continue with usual full resynchronization, however\r\n-     * when this happens masterTryPartialResynchronization() already\r\n-     * replied with:\r\n-     *\r\n-     * +FULLRESYNC &lt;runid&gt; &lt;offset&gt;\r\n-     *\r\n-     * So the slave knows the new runid and offset to try a PSYNC later\r\n-     * if the connection with the master is lost. *\/\r\n<\/span><span class=\"gi\">+    \/* PSYNC\u30b3\u30de\u30f3\u30c9\u306e\u5834\u5408\u3001\u90e8\u5206\u7684\u306a\u540c\u671f\u3092\u8a66\u3057\u307e\u3059\u3002\u5931\u6557\u3057\u305f\u5834\u5408\u306f\u3001\u901a\u5e38\u5b8c\u5168\r\n+     * \u306a\u540c\u671f\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3057\u304b\u3057\u3001masterTryPartialResynchronization() \u304c\r\n+     *   FULLRESYNC &lt;runid&gt; &lt;offset&gt;``\r\n+     * \u3092\u8fd4\u3059\u305f\u3081\u3001\u30b9\u30ec\u30fc\u30d6\u306f\u30de\u30b9\u30bf\u30fc\u3068\u306e\u63a5\u7d9a\u304c\u5931\u308f\u308c\u305f\u5834\u5408\u3067\u3082\u5f8c\u3067\u65b0\u3057\u3044\r\n+     * runid\u3068\u30aa\u30d5\u30bb\u30c3\u30c8\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b\u305f\u3081PSYNC\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002*\/\r\n<\/span>     if (!strcasecmp(c-&gt;argv[0]-&gt;ptr,\"psync\")) {\r\n         if (masterTryPartialResynchronization(c) == REDIS_OK) {\r\n             server.stat_sync_partial_ok++;\r\n<span class=\"gd\">-            return; \/* No full resync needed, return. *\/\r\n<\/span><span class=\"gi\">+            return; \/* \u5b8c\u5168\u540c\u671f\u3092\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 *\/\r\n<\/span>         } else {\r\n             char *master_runid = c-&gt;argv[1]-&gt;ptr;\r\n\r\n-            \/* Increment stats for failed PSYNCs, but only if the\r\n<span class=\"gd\">-             * runid is not \"?\", as this is used by slaves to force a full\r\n-             * resync on purpose when they are not albe to partially\r\n-             * resync. *\/\r\n<\/span><span class=\"gi\">+            \/* runid \u304c`?`\u3067\u306a\u3044\u5834\u5408\u306bPSYNC\u304c\u5931\u6557\u3057\u305f\u56de\u6570\u3092\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3057\u307e\u3059\u3002\r\n+             * \u3053\u308c\u306f\u3001\u30b9\u30ec\u30fc\u30d6\u90e8\u5206\u7684\u306a\u540c\u671f\u3092\u884c\u3048\u306a\u3044\u5834\u5408\u306b\u3001\u5f37\u5236\u7684\u306b\u5b8c\u5168\u306a\u540c\u671f\r\n+             * \u3092\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002*\/\r\n<\/span>             if (master_runid[0] != '?') server.stat_sync_partial_err++;\r\n         }\r\n     } else {\r\n<span class=\"gd\">-        \/* If a slave uses SYNC, we are dealing with an old implementation\r\n-         * of the replication protocol (like redis-cli --slave). Flag the client\r\n-         * so that we don't expect to receive REPLCONF ACK feedbacks. *\/\r\n<\/span><span class=\"gi\">+        \/* \u30b9\u30ec\u30fc\u30d6\u304cSYNC\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u5834\u5408\u3001redis-cli --salve \u306e\u69d8\u306a\u30ec\u30ac\u30b7\u30fc\u306a\r\n+         * \u540c\u671f\u51e6\u7406\u5b9f\u88c5\u3092\u5229\u7528\u3057\u307e\u3059\u3002REDIS_PRE_PSYNC\u30d5\u30e9\u30b0\u304c\u3042\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\r\n+         * REPLCONF ACK\u304c\u8fd4\u3089\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002*\/\r\n<\/span>         c-&gt;flags |= REDIS_PRE_PSYNC;\r\n     }\r\n\r\n-    \/* Full resynchronization. *\/\r\n<span class=\"gi\">+    \/* \u5b8c\u5168\u540c\u671f\u3092\u5b9f\u884c\u3002 *\/\r\n<\/span>     server.stat_sync_full++;\r\n\r\n-    \/* Here we need to check if there is a background saving operation\r\n<span class=\"gd\">-     * in progress, or if it is required to start one *\/\r\n<\/span><span class=\"gi\">+    \/* \u3053\u3053\u3067\u306f\u3001\u5b9f\u884c\u4e2d\u306b\u975e\u540c\u671f\u4fdd\u5b58\u51e6\u7406\u304c\u884c\u3048\u308b\u304b\u3001\u307e\u305f\u975e\u540c\u671f\u4fdd\u5b58\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\r\n+     * \u5fc5\u8981\u304c\u3042\u308b\u304b\u3092\u5224\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002*\/\r\n<\/span>     if (server.rdb_child_pid != -1) {\r\n<span class=\"gd\">-        \/* Ok a background save is in progress. Let's check if it is a good\r\n-         * one for replication, i.e. if there is another slave that is\r\n-         * registering differences since the server forked to save *\/\r\n<\/span><span class=\"gi\">+        \/* \u5b9f\u884c\u4e2d\u306b\u975e\u540c\u671f\u4fdd\u5b58\u304c\u884c\u3048\u308b\u5834\u5408\u3001\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u305f\u3081\u306e\u6761\u4ef6\u3092\u6e80\r\n+         * \u305f\u3057\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002\r\n+         * \u4f8b\uff09\u4ed6\u306e\u30b9\u30ec\u30fc\u30d6\u304c\u3001\u4fdd\u5b58\u306e\u305f\u3081\u306b\u30d5\u30a9\u30fc\u30af\u3055\u308c\u3066\u304b\u3089\u306e\u5dee\u5206\u3092\u767b\u9332\u3057\u3066\u3044\r\n+         *     \u308b\u304b\u3002 *\/\r\n<\/span>         redisClient *slave;\r\n         listNode *ln;\r\n         listIter li;\r\n<span class=\"p\">@@ -481,19 +477,20 @@<\/span> void syncCommand(redisClient *c) {\r\n             if (slave-&gt;replstate == REDIS_REPL_WAIT_BGSAVE_END) break;\r\n         }\r\n         if (ln) {\r\n<span class=\"gd\">-            \/* Perfect, the server is already registering differences for\r\n-             * another slave. Set the right state, and copy the buffer. *\/\r\n<\/span><span class=\"gi\">+            \/* \u5b8c\u74a7\uff01 \u30b5\u30fc\u30d0\u306f\u65e2\u306b\u4ed6\u306e\u30b9\u30ec\u30fc\u30d6\u3068\u306e\u5dee\u5206\u3092\u767b\u9332\u3057\u3066\u3044\u308b\u3002\r\n+             * \u30d0\u30c3\u30d5\u30a1\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u306bREDIS_REPL_WAIT_BGSAVE_END\u3092\r\n+             * \u30bb\u30c3\u30c8\u3057\u307e\u3057\u3087\u3046\u3002*\/\r\n<\/span>             copyClientOutputBuffer(c,slave);\r\n             c-&gt;replstate = REDIS_REPL_WAIT_BGSAVE_END;\r\n             redisLog(REDIS_NOTICE,\"Waiting for end of BGSAVE for SYNC\");\r\n         } else {\r\n<span class=\"gd\">-            \/* No way, we need to wait for the next BGSAVE in order to\r\n-             * register differences *\/\r\n<\/span><span class=\"gi\">+            \/* \u305d\u3093\u306a\u30d0\u30ab\u306a\uff01 \u30b5\u30fc\u30d0\u306f\u5dee\u5206\u3092\u767b\u9332\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306eBGSAVE\u3092\u5f85\u3064\r\n+             * \u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 *\/\r\n<\/span>             c-&gt;replstate = REDIS_REPL_WAIT_BGSAVE_START;\r\n             redisLog(REDIS_NOTICE,\"Waiting for next BGSAVE for SYNC\");\r\n         }\r\n     } else {\r\n<span class=\"gd\">-        \/* Ok we don't have a BGSAVE in progress, let's start one *\/\r\n<\/span><span class=\"gi\">+        \/* \u51e6\u7406\u4e2d\u306eBGSAVE\u304c\u7121\u3044\u5834\u5408\u3001BGSAVE\u3092\u958b\u59cb\u3057\u307e\u3059\u3002*\/\r\n<\/span>         redisLog(REDIS_NOTICE,\"Starting BGSAVE for SYNC\");\r\n         if (rdbSaveBackground(server.rdb_filename) != REDIS_OK) {\r\n             redisLog(REDIS_NOTICE,\"Replication failed, can't BGSAVE\");\r\n<span class=\"p\">@@ -501,15 +498,15 @@<\/span> void syncCommand(redisClient *c) {\r\n             return;\r\n         }\r\n         c-&gt;replstate = REDIS_REPL_WAIT_BGSAVE_END;\r\n<span class=\"gd\">-        \/* Flush the script cache for the new slave. *\/\r\n<\/span><span class=\"gi\">+        \/* \u65b0\u3057\u3044\u30b9\u30ec\u30fc\u30d6\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d5\u30e9\u30c3\u30b7\u30e5\u3057\u307e\u3059\u3002 *\/\r\n<\/span>         replicationScriptCacheFlush();\r\n     }\r\n\r\n     if (server.repl_disable_tcp_nodelay)\r\n<span class=\"gd\">-        anetDisableTcpNoDelay(NULL, c-&gt;fd); \/* Non critical if it fails. *\/\r\n<\/span><span class=\"gi\">+        anetDisableTcpNoDelay(NULL, c-&gt;fd); \/* \u30af\u30ea\u30c6\u30a3\u30ab\u30eb\u306a\u30a8\u30e9\u30fc\u3067\u306f\u7121\u3044\u3002 *\/\r\n<\/span>     c-&gt;repldbfd = -1;\r\n     c-&gt;flags |= REDIS_SLAVE;\r\n<span class=\"gd\">-    server.slaveseldb = -1; \/* Force to re-emit the SELECT command. *\/\r\n<\/span><span class=\"gi\">+    server.slaveseldb = -1; \/* \u5f37\u5236\u7684\u306bSELECT\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002 *\/\r\n<\/span>     listAddNodeTail(server.slaves,c);\r\n     if (listLength(server.slaves) == 1 &amp;&amp; server.repl_backlog == NULL)\r\n         createReplicationBacklog();\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u63a7\u5236BGSAVE\u5904\u7406\u7684\u5185\u5b58\u6d88\u8017\uff0c\u5c31\u65e0\u6cd5\u6709\u6548\u5229\u7528\u7269\u7406\u5185\u5b58\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u60f3\u8981\u4e86\u89e3Redis\u7684\u590d\u5236\u529f\u80fd\u5728\u505a\u4ec0\u4e48\uff0c\u6240\u4ee5\u8fb9\u9605\u8bfb\u6e90\u4ee3\u7801\u8fb9\u7ffb\u8bd1\u3002 diff &#8211;git a\/src\/repli [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34364","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7ffb\u8bd1\u8bf4\u660eredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1-patchredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch\" \/>\n<meta property=\"og:description\" content=\"\u6211\u60f3\u8981\u4e86\u89e3Redis\u7684\u590d\u5236\u529f\u80fd\u5728\u505a\u4ec0\u4e48\uff0c\u6240\u4ee5\u8fb9\u9605\u8bfb\u6e90\u4ee3\u7801\u8fb9\u7ffb\u8bd1\u3002 diff --git a\/src\/repli [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7ffb\u8bd1\u8bf4\u660eredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1-patchredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-09T03:34:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T15:17:27+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/\",\"name\":\"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-09T03:34:12+00:00\",\"dateModified\":\"2024-04-28T15:17:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u7ffb\u8bd1\u8bf4\u660eredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1-patchredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\/","og_locale":"zh_CN","og_type":"article","og_title":"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch","og_description":"\u6211\u60f3\u8981\u4e86\u89e3Redis\u7684\u590d\u5236\u529f\u80fd\u5728\u505a\u4ec0\u4e48\uff0c\u6240\u4ee5\u8fb9\u9605\u8bfb\u6e90\u4ee3\u7801\u8fb9\u7ffb\u8bd1\u3002 diff --git a\/src\/repli [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u7ffb\u8bd1\u8bf4\u660eredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1-patchredis\u7684synccommand\u51fd\u6570\u7684\u6ce8\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-09T03:34:12+00:00","article_modified_time":"2024-04-28T15:17:27+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/","name":"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-09T03:34:12+00:00","dateModified":"2024-04-28T15:17:27+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u7ffb\u8bd1\u8bf4\u660e:Redis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patchRedis\u7684syncCommand()\u51fd\u6570\u7684\u6ce8\u91ca\u7ffb\u8bd1.patch"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bf%bb%e8%af%91%e8%af%b4%e6%98%8eredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8%e9%87%8a%e7%bf%bb%e8%af%91-patchredis%e7%9a%84synccommand%e5%87%bd%e6%95%b0%e7%9a%84%e6%b3%a8\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=34364"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34364\/revisions"}],"predecessor-version":[{"id":64421,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34364\/revisions\/64421"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=34364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=34364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=34364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}