public void add(ProcedureProtos.Procedure procProto) { trackProcIds(procProto.getProcId()); Entry entry = addToMap(procProto.getProcId(), procProto.hasParentId()); boolean newEntry = entry.proto == null; // We have seen procedure WALs where the entries are out of order; see HBASE-18152. // To compensate, only replace the Entry procedure if for sure this new procedure // is indeed an entry that came later. TODO: Fix the writing of procedure info so // it does not violate basic expectation, that WALs contain procedure changes going // from start to finish in sequence. if (newEntry || isIncreasing(entry.proto, procProto)) { entry.proto = procProto; } addToReplayList(entry); if(newEntry) { if (procProto.hasParentId()) { childUnlinkedHead = addToLinkList(entry, childUnlinkedHead); } else { rootHead = addToLinkList(entry, rootHead); } } }