This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 91cf777 HDDS-6262. ozone insight log stops working after OM DBUpdates
message (#3044)
91cf777 is described below
commit 91cf777b028a2e907b016941160b232ecf587884
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Thu Feb 17 17:22:40 2022 +0100
HDDS-6262. ozone insight log stops working after OM DBUpdates message
(#3044)
---
.../apache/hadoop/ozone/protocolPB/OMPBHelper.java | 37 +++++++++++++++++-----
...OzoneManagerProtocolServerSideTranslatorPB.java | 2 +-
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/protocolPB/OMPBHelper.java
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/protocolPB/OMPBHelper.java
index 51c7d54..810111d 100644
---
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/protocolPB/OMPBHelper.java
+++
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/protocolPB/OMPBHelper.java
@@ -24,14 +24,12 @@ import org.apache.hadoop.fs.FileEncryptionInfo;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.ozone.om.helpers.BucketEncryptionKeyInfo;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
-import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos
- .BucketEncryptionInfoProto;
-import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos
- .CipherSuiteProto;
-import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos
- .CryptoProtocolVersionProto;
-import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos
- .FileEncryptionInfoProto;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.BucketEncryptionInfoProto;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CipherSuiteProto;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CryptoProtocolVersionProto;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.FileEncryptionInfoProto;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
import org.apache.hadoop.ozone.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.security.token.Token;
@@ -41,6 +39,9 @@ import org.apache.hadoop.security.token.Token;
*/
public final class OMPBHelper {
+ public static final ByteString REDACTED =
+ ByteString.copyFromUtf8("<redacted>");
+
private OMPBHelper() {
/** Hidden constructor */
}
@@ -192,4 +193,24 @@ public final class OMPBHelper {
}
+ public static OMRequest processForDebug(OMRequest msg) {
+ return msg;
+ }
+
+ public static OMResponse processForDebug(OMResponse msg) {
+ if (msg == null) {
+ return null;
+ }
+
+ if (msg.hasDbUpdatesResponse()) {
+ OMResponse.Builder builder = msg.toBuilder();
+
+ builder.getDbUpdatesResponseBuilder()
+ .clearData().addData(REDACTED);
+
+ return builder.build();
+ }
+
+ return msg;
+ }
}
diff --git
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
index 7946f65..ef82069 100644
---
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
+++
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
@@ -109,7 +109,7 @@ public class OzoneManagerProtocolServerSideTranslatorPB
implements
}
this.omRatisServer = ratisServer;
dispatcher = new OzoneProtocolMessageDispatcher<>("OzoneProtocol",
- metrics, LOG);
+ metrics, LOG, OMPBHelper::processForDebug,
OMPBHelper::processForDebug);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]