YongGoose commented on code in PR #7344: URL: https://github.com/apache/incubator-seata/pull/7344#discussion_r2095745040
########## server/src/main/java/org/apache/seata/server/session/BranchSession.java: ########## @@ -336,33 +336,11 @@ public byte[] encode() { byte[] xidBytes = xid != null ? xid.getBytes() : null; byte branchTypeByte = branchType != null ? (byte) branchType.ordinal() : -1; - - int size = calBranchSessionSize(resourceIdBytes, lockKeyBytes, clientIdBytes, applicationDataBytes, xidBytes); - - if (size > MAX_BRANCH_SESSION_SIZE) { - if (lockKeyBytes == null) { - throw new RuntimeException("branch session size exceeded, size : " + size + " maxBranchSessionSize : " - + MAX_BRANCH_SESSION_SIZE); - } - // try compress lockkey - try { - size -= lockKeyBytes.length; - lockKeyBytes = CompressUtil.compress(lockKeyBytes); - } catch (IOException e) { - LOGGER.error("compress lockKey error", e); - } finally { - size += lockKeyBytes.length; - } - - if (size > MAX_BRANCH_SESSION_SIZE) { - throw new RuntimeException( - "compress branch session size exceeded, compressSize : " + size + " maxBranchSessionSize : " - + MAX_BRANCH_SESSION_SIZE); - } + if (!RaftServerManager.isRaftMode()) { + checkSize(resourceIdBytes, lockKeyBytes, clientIdBytes, applicationDataBytes, xidBytes); Review Comment: I have one question. The title of the PR says that the size check for transactions is performed in advance in Raft mode, but the relevant code seems to perform the check in advance even in modes other than Raft. If I’ve misunderstood something, I apologize in advance :) -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org