HDFS-16869 Fail to start NameNode when replay editlog onwing to 0 size of clientId or callId recorded in editlog

This commit is contained in:
Daniel-009497 2022-12-17 16:07:14 +08:00
parent ca3526da92
commit 8ce1ef6d3d
1 changed files with 4 additions and 0 deletions

View File

@ -320,6 +320,10 @@ public class RetryCache {
public void addCacheEntryWithPayload(byte[] clientId, int callId,
Object payload) {
// invalid callId or clientId recorded in edit log which is meaningless and no need to be added into cache.
if (skipRetryCache(clientId, callId)) {
return;
}
// since the entry is loaded from editlog, we can assume it succeeded.
CacheEntry newEntry = new CacheEntryWithPayload(clientId, callId, payload,
System.nanoTime() + expirationTime, true);