{"record":{"id":"ac33a6a2e5f94c3a","repo":"microsoft/garnet","slug":"replay-header-type-replayheadertype-not-supporte","errorCode":null,"errorMessage":"Replay header type {replayHeaderType} not supported!","messagePattern":"Replay header type (.+?) not supported!","errorType":"exception","errorClass":"GarnetException","httpStatus":null,"severity":"critical","filePath":"libs/server/AOF/AofProcessor.cs","lineNumber":812,"sourceCode":"                    if (!header.opType.HasKey())\n                        return replayTaskIdx == 0;\n                    var curr = AofHeader.SkipHeader(ptr);\n                    var key = PinnedSpanByte.FromLengthPrefixedPinnedPointer(curr).ReadOnlySpan;\n                    return replayTaskIdx == storeWrapper.appendOnlyFile.Log.GetReplayTaskIdx(key);\n                // Single-physical-log + multi-replay: transaction header without sequence number\n                case AofHeaderType.SingleLogTransactionHeader:\n                    var singleLogTxnHeader = *(AofSingleLogTransactionHeader*)ptr;\n                    logAddressSequenceNumber = entryAddress;\n                    var singleLogBitVector = BitVector.CopyFrom(new Span<byte>(singleLogTxnHeader.replayTaskAccessVector, AofShardedLogTransactionHeader.ReplayTaskAccessVectorBytes));\n                    return singleLogBitVector.IsSet(replayTaskIdx);\n                // Multi-physical-log: transaction header with embedded sequence number\n                case AofHeaderType.ShardedLogTransactionHeader:\n                    var txnHeader = *(AofShardedLogTransactionHeader*)ptr;\n                    logAddressSequenceNumber = txnHeader.shardedHeader.sequenceNumber;\n                    var bitVector = BitVector.CopyFrom(new Span<byte>(txnHeader.replayTaskAccessVector, AofShardedLogTransactionHeader.ReplayTaskAccessVectorBytes));\n                    return bitVector.IsSet(replayTaskIdx);\n                default:\n                    throw new GarnetException($\"Replay header type {replayHeaderType} not supported!\");\n            }\n        }\n\n        /// <summary>\n        /// Calculates the index of the replay task associated with the specified AOF header pointer.\n        /// </summary>\n        /// <param name=\"ptr\">A pointer to a byte array representing the AOF header.</param>\n        /// <returns>The zero-based index of the replay task to which the entry should be assigned. Returns -1 if the header type\n        /// does not contain a key for task assignment.</returns>\n        /// <exception cref=\"GarnetException\">Thrown when the AOF header type referenced by <paramref name=\"ptr\"/> is not supported.</exception>\n        public int GetReplayTaskIdx(byte* ptr)\n        {\n            var header = *(AofHeader*)ptr;\n            var replayHeaderType = header.HeaderType;\n            switch (replayHeaderType)\n            {\n                // Single-physical-log + multi-replay: BasicHeader entries\n                case AofHeaderType.BasicHeader:","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/server/AOF/AofProcessor.cs#L794-L830","documentation":"Thrown inside AofProcessor when checking whether a given replay task bit is set in an AOF entry's access vector (the method that reads replayTaskAccessVector from transaction headers). The switch dispatches on replayHeaderType and falls through to default for any AofHeaderType other than SingleLogTransactionHeader and ShardedLogTransactionHeader.","triggerScenarios":"A replay-task-membership check is invoked on a header whose type is neither of the two transaction-header types that carry a replayTaskAccessVector. This implies the pointer does not point at a valid transaction header — corruption or a pointer-advancement error.","commonSituations":"Corrupted AOF data feeding an unexpected header type into the replay-task bitmap path; a pointer-arithmetic bug advancing past a valid entry; version mismatch changing header layout.","solutions":["Confirm the AOF/checkpoint is from a Garnet version with a compatible header layout.","Restore from a known-good backup to rule out corruption.","If the data is clean, report the replayHeaderType value and call site to Garnet maintainers."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { var set = IsReplayTaskSet(ptr, replayTaskIdx, out var seq); }\ncatch (GarnetException ex) { logger.LogCritical(ex, \"Unrecognized replay header type\"); throw; }","preventionTips":["Maintain version parity across the cluster.","Keep checkpoint+AOF backups.","Investigate disk integrity on recurring corruption."],"tags":["aof","data-corruption","replay","internal"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}