microsoft/garnet · critical · GarnetException

Replay header type {replayHeaderType} not supported!

Error message

Replay header type {replayHeaderType} not supported!

What it means

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.

Source

Thrown at libs/server/AOF/AofProcessor.cs:812

                    if (!header.opType.HasKey())
                        return replayTaskIdx == 0;
                    var curr = AofHeader.SkipHeader(ptr);
                    var key = PinnedSpanByte.FromLengthPrefixedPinnedPointer(curr).ReadOnlySpan;
                    return replayTaskIdx == storeWrapper.appendOnlyFile.Log.GetReplayTaskIdx(key);
                // Single-physical-log + multi-replay: transaction header without sequence number
                case AofHeaderType.SingleLogTransactionHeader:
                    var singleLogTxnHeader = *(AofSingleLogTransactionHeader*)ptr;
                    logAddressSequenceNumber = entryAddress;
                    var singleLogBitVector = BitVector.CopyFrom(new Span<byte>(singleLogTxnHeader.replayTaskAccessVector, AofShardedLogTransactionHeader.ReplayTaskAccessVectorBytes));
                    return singleLogBitVector.IsSet(replayTaskIdx);
                // Multi-physical-log: transaction header with embedded sequence number
                case AofHeaderType.ShardedLogTransactionHeader:
                    var txnHeader = *(AofShardedLogTransactionHeader*)ptr;
                    logAddressSequenceNumber = txnHeader.shardedHeader.sequenceNumber;
                    var bitVector = BitVector.CopyFrom(new Span<byte>(txnHeader.replayTaskAccessVector, AofShardedLogTransactionHeader.ReplayTaskAccessVectorBytes));
                    return bitVector.IsSet(replayTaskIdx);
                default:
                    throw new GarnetException($"Replay header type {replayHeaderType} not supported!");
            }
        }

        /// <summary>
        /// Calculates the index of the replay task associated with the specified AOF header pointer.
        /// </summary>
        /// <param name="ptr">A pointer to a byte array representing the AOF header.</param>
        /// <returns>The zero-based index of the replay task to which the entry should be assigned. Returns -1 if the header type
        /// does not contain a key for task assignment.</returns>
        /// <exception cref="GarnetException">Thrown when the AOF header type referenced by <paramref name="ptr"/> is not supported.</exception>
        public int GetReplayTaskIdx(byte* ptr)
        {
            var header = *(AofHeader*)ptr;
            var replayHeaderType = header.HeaderType;
            switch (replayHeaderType)
            {
                // Single-physical-log + multi-replay: BasicHeader entries
                case AofHeaderType.BasicHeader:

View on GitHub (pinned to 951b0fc683)

Solutions

  1. Confirm the AOF/checkpoint is from a Garnet version with a compatible header layout.
  2. Restore from a known-good backup to rule out corruption.
  3. If the data is clean, report the replayHeaderType value and call site to Garnet maintainers.
Defensive patterns

Strategy: try-catch

Try / catch

try { var set = IsReplayTaskSet(ptr, replayTaskIdx, out var seq); }
catch (GarnetException ex) { logger.LogCritical(ex, "Unrecognized replay header type"); throw; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of microsoft/garnet@951b0fc683 (2026-08-13). Data as JSON: /api/errors/ac33a6a2e5f94c3a. Report an issue: GitHub.