microsoft/garnet · error · NotImplementedException

IHeapObject value) is not supported in this ISessionFunction

Error message

IHeapObject value) is not supported in this ISessionFunctions implementation

What it means

This is the IHeapObject overload of GetUpsertFieldInfo on NoOpSessionFunctions. It throws NotImplementedException because compaction never upserts an object value directly — it copies from a source log record via the ISourceLogRecord overload. Note: the exception message has a formatting issue ('IHeapObject value) is not supported') — the opening parenthesis and method name are missing, likely a copy-paste artifact from line 88.

Source

Thrown at libs/storage/Tsavorite/cs/src/core/ClientSession/NoOpSessionFunctions.cs:94

             => throw new NotImplementedException("GetRMWModifiedFieldInfo is not supported in this ISessionFunctions implementation");
        public readonly RecordFieldInfo GetRMWInitialFieldInfo<TKey>(TKey key, ref TInput input)
            where TKey : IKey
#if NET9_0_OR_GREATER
                , allows ref struct
#endif
            => throw new NotImplementedException("GetRMWInitialFieldInfo is not supported in this ISessionFunctions implementation");
        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey>(TKey key, ReadOnlySpan<byte> value, ref TInput input)
            where TKey : IKey
#if NET9_0_OR_GREATER
                , allows ref struct
#endif
            => throw new NotImplementedException("GetUpsertFieldInfo(ReadOnlySpan<byte> value) is not supported in this ISessionFunctions implementation");
        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey>(TKey key, IHeapObject value, ref TInput input)
            where TKey : IKey
#if NET9_0_OR_GREATER
                , allows ref struct
#endif
            => throw new NotImplementedException("IHeapObject value) is not supported in this ISessionFunctions implementation");
        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey, TSourceLogRecord>(TKey key, in TSourceLogRecord inputLogRecord, ref TInput input)
            where TKey : IKey
#if NET9_0_OR_GREATER
                , allows ref struct
#endif
            where TSourceLogRecord : ISourceLogRecord
            => new() { KeySize = key.KeyBytes.Length, ValueSize = inputLogRecord.DataHeader.ValueIsObject ? ObjectIdMap.ObjectIdSize : inputLogRecord.ValueSpan.Length, ValueIsObject = inputLogRecord.DataHeader.ValueIsObject, ExtendedNamespaceSize = RecordNamespace.GetExtendedNamespaceSize(in key) };

        /// <summary>
        /// No reads during compaction
        /// </summary>
        public readonly bool Reader<TSourceLogRecord>(in TSourceLogRecord srcLogRecord, ref TInput input, ref TOutput dst, ref ReadInfo readInfo)
            where TSourceLogRecord : ISourceLogRecord
            => true;

        /// <summary>
        /// Write compacted live value to store
        /// </summary>

View on GitHub (pinned to 951b0fc683)

Solutions

  1. Report as a Tsavorite framework bug — note also that the exception message text is malformed (missing method name prefix).
  2. If implementing custom ISessionFunctions, implement the IHeapObject GetUpsertFieldInfo overload to return proper RecordFieldInfo.
  3. Test whether the issue is specific to object-mode (IHeapObject) values vs span-based values.
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    store.Log.ShiftHeadAddressForCompaction(targetAddress);
}
catch (NotImplementedException ex) when (ex.Message.Contains("IHeapObject"))
{
    logger.LogCritical("Compaction hit unsupported IHeapObject GetUpsertFieldInfo path: {Message}", ex.Message);
    throw;
}

Prevention

When it happens

Trigger: Tsavorite's internal compaction code calls GetUpsertFieldInfo(TKey, IHeapObject value, ref TInput) on a NoOpSessionFunctions session, indicating a heap-object-value upsert path was entered during compaction instead of the record-copy path.

Common situations: Framework bug in compaction handling of object-mode values; a version of Tsavorite with a regression in object-value compaction dispatch.

Related errors


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