devmadhuu commented on code in PR #5490:
URL: https://github.com/apache/ozone/pull/5490#discussion_r1410174531
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OMDBUpdatesHandler.java:
##########
@@ -153,8 +155,22 @@ private void processEvent(int cfIndex, byte[] keyBytes,
byte[]
}
}
} else if (action.equals(DELETE)) {
- if (oldValue != null && !omUpdateEventValidator.isValidEvent(tableName,
- oldValue, key, action)) {
+ if (null == oldValue) {
+ String keyStr = (key instanceof String) ? key.toString() : "";
+ if (keyStr.isEmpty()) {
+ LOG.warn(
+ "Only DTOKEN_TABLE table uses OzoneTokenIdentifier as key " +
+ "instead of String. Event on any other table in this " +
+ "condition may need to be investigated. This DELETE " +
+ "event is on {} table which is not useful for Recon to " +
+ "capture.", tableName);
+ }
+ LOG.warn("Old Value of Key: {} in table: {} should not be null " +
+ "for DELETE event ", keyStr, tableName);
+ return;
Review Comment:
@dombizita , I feel, current approach is better because if oldValue is null,
which is more important for us, so we are printing the message that "Old value
of key {} in table {} should not be null" and here we are printing both
non-empty key as well as table name associated with that key which has its old
value as null. This should be more helpful in debugging later. First log
message which is getting printed is on condition `if (keyStr.isEmpty())` and
this condition also is inside the condition` if (null == oldValue)` , so key
can only be empty if it is not of string type and non string type is anyway not
relevant for Recon to capture, but still this log message will be helpful and
see if event is really based on `DTOKEN_TABLE` with what is intended for.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]