You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/11/16 08:22:42 UTC
[dubbo-website] branch master updated: Add desc of disable empty protection (#1603)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new f71ae8d59f7 Add desc of disable empty protection (#1603)
f71ae8d59f7 is described below
commit f71ae8d59f72122e9ff20aac8d47e1a77fa4f88e
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Wed Nov 16 16:22:37 2022 +0800
Add desc of disable empty protection (#1603)
---
.../3.1-to-3.2-compatibility-guide.md | 32 ++++++++++++++++++----
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/content/zh/docs3-v2/java-sdk/upgrades-and-compatibility/3.1-to-3.2-compatibility-guide.md b/content/zh/docs3-v2/java-sdk/upgrades-and-compatibility/3.1-to-3.2-compatibility-guide.md
index 4667fd07dbe..1d1b89967b7 100644
--- a/content/zh/docs3-v2/java-sdk/upgrades-and-compatibility/3.1-to-3.2-compatibility-guide.md
+++ b/content/zh/docs3-v2/java-sdk/upgrades-and-compatibility/3.1-to-3.2-compatibility-guide.md
@@ -6,15 +6,15 @@ weight: 1001
description: "快速了解 Dubbo 3.2 的升级步骤与兼容性"
---
-## 功能修改点
+# 功能修改点
-### 1. 传递依赖变更
+## 1. 传递依赖变更
* Dubbo 3.2.0 版本开始默认不再在 `dubbo-all` 中 shade `hessian-lite` 的代码,而是使用传递依赖传递。如果你的应用中不需要使用 `hessian-lite`,可以将 `hessian-lite` 从依赖中移除。
* Dubbo 3.2.0 版本开始在 `dubbo-all` 中不再传递 `gson`、`fastjson` 依赖,如果你的应用中需要使用 `gson`、`fastjson`,请手动将 `gson`、`fastjson` 依赖添加到应用中。
* Dubbo 3.2.0 版本在 `dubbo-all` 中传递 `fastjson2` 依赖。
-### 2. 默认序列化切换
+## 2. 默认序列化切换
* Dubbo 3.2.0 版本开始默认序列化方式从 `hessian2` 切换为 `fastjson2`,对于升级到 3.2.0 的应用,Dubbo 会自动尝试采用 `fastjson2` 进行序列化。
@@ -38,7 +38,7 @@ Dubbo 中使用 `fastjson2` 的 JSONB 格式,而不是原生的 JSON 格式。
如果你不想使用 `fastjson2`,可以配置 `prefer-serialization` 为 `hessian2` 覆盖默认配置。(如 `dubbo.provider.prefer-serialization=fastjson2,hessian2`) 如果没有特殊的需求,我们不建议仍继续使用 `hessian2`。
-### 3. 默认内部序列化工具切换
+## 3. 默认内部序列化工具切换
* Dubbo 3.2.0 版本开始默认**内部**序列化工具从 `fastjson` 切换为 `fastjson2`。
@@ -60,6 +60,26 @@ Dubbo 支持多种序列化框架自动切换,如果你的环境中没有 `fas
可以配置 `dubbo.json-framework.prefer` 参数,如 `-Ddubbo.json-framework.prefer=gson`。
-### 4. Triple 协议支持传递自定义异常
+## 4. Triple 协议支持传递自定义异常
-* Dubbo 3.2.0 版本开始 Triple 协议支持回传自定义异常,而不是只能回传 `RpcException`。如果服务接口会抛出异常的,在 Dubbo 3.2.0 版本以后将默认按照 Dubbo 协议一样回传自定义异常对象。
\ No newline at end of file
+* Dubbo 3.2.0 版本开始 Triple 协议支持回传自定义异常,而不是只能回传 `RpcException`。如果服务接口会抛出异常的,在 Dubbo 3.2.0 版本以后将默认按照 Dubbo 协议一样回传自定义异常对象。
+
+## 5. 默认关闭推空保护
+
+* Dubbo 3.2.0 版本开始默认关闭推空保护,即使注册中心推送空地址,Dubbo 也将不会保留最后一批 provider 信息。
+如果需要开启推空保护,可以配置 `dubbo.application.enable-empty-protection` 为 `true`。
+
+#### FAQ
+
+#### Q1:关闭推空保护对我有什么影响?
+
+在绝大部分场景下没有影响。
+推空保护的目的是在注册中心出现故障并且主动推送空地址的时候,Dubbo 保留最后一批 provider 信息,以保证服务可用。
+但是在大多数注册中心出现故障的时候,注册中心也不会推送空地址,只有一些特殊情况才会出现。
+但如果开启推空保护,将对 Dubbo 的 Fallback 逻辑、心跳逻辑等造成较大的影响,给开发使用 Dubbo 带来困扰。
+
+#### Q2:我想开启推空保护,怎么办?
+
+如果在生产上为了高可用,需要开启推空保护,可以配置 `dubbo.application.enable-empty-protection` 为 `true`。
+目前已知开启推空保护会导致服务端应用从 `2.6.x`、`2.7.x` 等仅支持接口级服务发现的版本升级到 `3.x` 之后回滚到原来版本出现异常,极端场景下会导致服务调用失败。
+此外,开启推空保护后在服务端地址真的为空的时候出现较多的心跳异常、日志异常等。