| | |
| | | package org.opends.server.backends.jeb; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | |
| | | import com.sleepycat.je.Cursor; |
| | | import com.sleepycat.je.CursorConfig; |
| | |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCaught; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugError; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.messages.JebMessages.*; |
| | |
| | | */ |
| | | public class VerifyJob |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | |
| | | /** |
| | | * The verify configuration. |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Malformed id2entry ID %s.%n", |
| | | TRACER.debugError("Malformed id2entry ID %s.%n", |
| | | StaticUtils.bytesToHex(key.getData())); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Malformed id2entry record for ID %d:%n%s%n", |
| | | TRACER.debugError("Malformed id2entry record for ID %d:%n%s%n", |
| | | entryID.longValue(), |
| | | StaticUtils.bytesToHex(data.getData())); |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("The stored entry count in id2entry (%d) does " + |
| | | TRACER.debugError("The stored entry count in id2entry (%d) does " + |
| | | "not agree with the actual number of entry " + |
| | | "records found (%d).%n", storedEntryCount, keyCount); |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has malformed key %s.%n", |
| | | TRACER.debugError("File dn2id has malformed key %s.%n", |
| | | StaticUtils.bytesToHex(key.getData())); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has malformed ID for DN <%s>:%n%s%n", |
| | | TRACER.debugError("File dn2id has malformed ID for DN <%s>:%n%s%n", |
| | | dn.toNormalizedString(), |
| | | StaticUtils.bytesToHex(data.getData())); |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id has DN <%s> referencing unknown " + |
| | | TRACER.debugError("File dn2id has DN <%s> referencing unknown " + |
| | | "ID %d%n", dn.toNormalizedString(), entryID.longValue()); |
| | | } |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id has DN <%s> referencing entry " + |
| | | TRACER.debugError("File dn2id has DN <%s> referencing entry " + |
| | | "with wrong DN <%s>%n", dn.toNormalizedString(), |
| | | entry.getDN().toNormalizedString()); |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2children has malformed ID %s%n", |
| | | TRACER.debugError("File id2children has malformed ID %s%n", |
| | | StaticUtils.bytesToHex(key.getData())); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2children has malformed ID list " + |
| | | TRACER.debugError("File id2children has malformed ID list " + |
| | | "for ID %s:%n%s%n", entryID, |
| | | StaticUtils.bytesToHex(data.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorCount++; |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2children has unknown ID %d%n", |
| | | TRACER.debugError("File id2children has unknown ID %d%n", |
| | | entryID.longValue()); |
| | | } |
| | | continue; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorCount++; |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2children has ID %d referencing " + |
| | | TRACER.debugError("File id2children has ID %d referencing " + |
| | | "unknown ID %d%n", entryID.longValue(), id.longValue()); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2children has ID %d with DN <%s> " + |
| | | TRACER.debugError("File id2children has ID %d with DN <%s> " + |
| | | "referencing ID %d with non-child DN <%s>%n", |
| | | entryID.longValue(), entry.getDN().toString(), |
| | | id.longValue(), childEntry.getDN().toString()); |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2subtree has malformed ID %s%n", |
| | | TRACER.debugError("File id2subtree has malformed ID %s%n", |
| | | StaticUtils.bytesToHex(key.getData())); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2subtree has malformed ID list " + |
| | | TRACER.debugError("File id2subtree has malformed ID list " + |
| | | "for ID %s:%n%s%n", entryID, |
| | | StaticUtils.bytesToHex(data.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorCount++; |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2subtree has unknown ID %d%n", |
| | | TRACER.debugError("File id2subtree has unknown ID %d%n", |
| | | entryID.longValue()); |
| | | } |
| | | continue; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorCount++; |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2subtree has ID %d referencing " + |
| | | TRACER.debugError("File id2subtree has ID %d referencing " + |
| | | "unknown ID %d%n", entryID.longValue(), id.longValue()); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2subtree has ID %d with DN <%s> " + |
| | | TRACER.debugError("File id2subtree has ID %d with DN <%s> " + |
| | | "referencing ID %d with non-subordinate " + |
| | | "DN <%s>%n", |
| | | entryID.longValue(), entry.getDN().toString(), |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Malformed ID list: %s%n%s", |
| | | TRACER.debugError("Malformed ID list: %s%n%s", |
| | | StaticUtils.bytesToHex(data.getData()), |
| | | keyDump(index, key.getData())); |
| | | } |
| | |
| | | errorCount++; |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("Reversed ordering of index keys " + |
| | | TRACER.debugError("Reversed ordering of index keys " + |
| | | "(keys dumped in the order found in database)%n" + |
| | | "Key 1:%n%s%nKey 2:%n%s", |
| | | keyDump(index, thisValue.value()), |
| | |
| | | errorCount++; |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("Duplicate index keys%nKey 1:%n%s%nKey2:%n%s", |
| | | keyDump(index, thisValue.value()), |
| | | keyDump(index,previousValue.value())); |
| | | TRACER.debugError("Duplicate index keys%nKey 1:%n%s%n" + |
| | | "Key2:%n%s", keyDump(index, thisValue.value()), |
| | | keyDump(index,previousValue.value())); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Malformed value%n%s", keyDump(index, value)); |
| | | TRACER.debugError("Malformed value%n%s", keyDump(index, value)); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Duplicate reference to ID %d%n%s", |
| | | TRACER.debugError("Duplicate reference to ID %d%n%s", |
| | | id.longValue(), keyDump(index, key.getData())); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorCount++; |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Reference to unknown ID %d%n%s", |
| | | TRACER.debugError("Reference to unknown ID %d%n%s", |
| | | id.longValue(), keyDump(index, key.getData())); |
| | | } |
| | | continue; |
| | |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Reference to entry " + |
| | | TRACER.debugError("Reference to entry " + |
| | | "<%s> which does not match the value%n%s", |
| | | entry.getDN(), keyDump(index, value)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id is missing key %s.%n", |
| | | TRACER.debugError("File dn2id is missing key %s.%n", |
| | | dn.toNormalizedString()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id has ID %d instead of %d for key %s.%n", |
| | | TRACER.debugError("File dn2id has ID %d instead of %d for key %s.%n", |
| | | id.longValue(), |
| | | entryID.longValue(), |
| | | dn.toNormalizedString()); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has error reading key %s: %s.%n", |
| | | TRACER.debugError("File dn2id has error reading key %s: %s.%n", |
| | | dn.toNormalizedString(), |
| | | e.getMessage()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id is missing key %s.%n", |
| | | TRACER.debugError("File dn2id is missing key %s.%n", |
| | | parentDN.toNormalizedString()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has error reading key %s: %s.%n", |
| | | TRACER.debugError("File dn2id has error reading key %s: %s.%n", |
| | | parentDN.toNormalizedString(), |
| | | e.getMessage()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id is missing key %s.%n", |
| | | TRACER.debugError("File dn2id is missing key %s.%n", |
| | | parentDN.toNormalizedString()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has error reading key %s: %s.", |
| | | TRACER.debugError("File dn2id has error reading key %s: %s.", |
| | | parentDN.toNormalizedString(), |
| | | e.getMessage()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2children is missing ID %d " + |
| | | TRACER.debugError("File id2children is missing ID %d " + |
| | | "for key %d.%n", |
| | | entryID.longValue(), parentID.longValue()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2children has error reading key %d: %s.", |
| | | TRACER.debugError("File id2children has error reading key %d: %s.", |
| | | parentID.longValue(), e.getMessage()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File dn2id is missing key %s.%n", |
| | | TRACER.debugError("File dn2id is missing key %s.%n", |
| | | dn.toNormalizedString()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File dn2id has error reading key %s: %s.%n", |
| | | TRACER.debugError("File dn2id has error reading key %s: %s.%n", |
| | | dn.toNormalizedString(), |
| | | e.getMessage()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("File id2subtree is missing ID %d " + |
| | | TRACER.debugError("File id2subtree is missing ID %d " + |
| | | "for key %d.%n", |
| | | entryID.longValue(), id.longValue()); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("File id2subtree has error reading key %d: %s.%n", |
| | | TRACER.debugError("File id2subtree has error reading key %d: %s.%n", |
| | | id.longValue(), e.getMessage()); |
| | | } |
| | | errorCount++; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error normalizing values of attribute %s in " + |
| | | TRACER.debugError("Error normalizing values of attribute %s in " + |
| | | "entry <%s>: %s.%n", |
| | | attrIndex.getAttributeType().toString(), |
| | | entry.getDN().toString(), |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Missing ID %d%n%s", |
| | | TRACER.debugError("Missing ID %d%n%s", |
| | | entryID.longValue(), |
| | | keyDump(presenceIndex, presenceKey.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error reading database: %s%n%s", |
| | | TRACER.debugError("Error reading database: %s%n%s", |
| | | e.getMessage(), |
| | | keyDump(presenceIndex, presenceKey.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Missing ID %d%n%s", |
| | | TRACER.debugError("Missing ID %d%n%s", |
| | | entryID.longValue(), |
| | | keyDump(equalityIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error reading database: %s%n%s", |
| | | TRACER.debugError("Error reading database: %s%n%s", |
| | | e.getMessage(), |
| | | keyDump(equalityIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Missing ID %d%n%s", |
| | | TRACER.debugError("Missing ID %d%n%s", |
| | | entryID.longValue(), |
| | | keyDump(substringIndex, key.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error reading database: %s%n%s", |
| | | TRACER.debugError("Error reading database: %s%n%s", |
| | | e.getMessage(), |
| | | keyDump(substringIndex, key.getData())); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Missing ID %d%n%s", |
| | | TRACER.debugError("Missing ID %d%n%s", |
| | | entryID.longValue(), |
| | | keyDump(orderingIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error reading database: %s%n%s", |
| | | TRACER.debugError("Error reading database: %s%n%s", |
| | | e.getMessage(), |
| | | keyDump(orderingIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugError("Missing ID %d%n%s", |
| | | TRACER.debugError("Missing ID %d%n%s", |
| | | entryID.longValue(), |
| | | keyDump(orderingIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | debugError("Error reading database: %s%n%s", |
| | | TRACER.debugError("Error reading database: %s%n%s", |
| | | e.getMessage(), |
| | | keyDump(approximateIndex, normalizedBytes)); |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |