microsoft/garnet · error · NotImplementedException

GetRMWInitialFieldInfo is not supported in this ISessionFunc

Error message

GetRMWInitialFieldInfo is not supported in this ISessionFunctions implementation

What it means

GetRMWInitialFieldInfo returns RecordFieldInfo for the initial creation of a record during RMW (when the key does not exist yet). NoOpSessionFunctions throws NotImplementedException because compaction does not perform RMW initial inserts — it only copies existing records. This method would be called when Tsavorite needs to size a new record for an RMW initial-update during a NoOp session.

Source

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

            => true;

        public readonly bool NeedCopyUpdate<TSourceLogRecord>(in TSourceLogRecord srcLogRecord, ref TInput input, ref TOutput output, ref RMWInfo rmwInfo)
            where TSourceLogRecord : ISourceLogRecord
            => true;

        public readonly void ReadCompletionCallback(ref DiskLogRecord diskLogRecord, ref TInput input, ref TOutput output, TContext ctx, Status status, RecordMetadata recordMetadata) { }

        public readonly void RMWCompletionCallback(ref DiskLogRecord diskLogRecord, ref TInput input, ref TOutput output, TContext ctx, Status status, RecordMetadata recordMetadata) { }

        public readonly RecordFieldInfo GetRMWModifiedFieldInfo<TSourceLogRecord>(in TSourceLogRecord srcLogRecord, ref TInput input)
            where TSourceLogRecord : ISourceLogRecord
             => 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

View on GitHub (pinned to 951b0fc683)

Solutions

  1. Report as a Tsavorite framework bug — compaction contexts using NoOpSessionFunctions should not trigger RMW initial operations.
  2. If writing custom ISessionFunctions, implement GetRMWInitialFieldInfo to compute key and value sizes for RMW-created records.
  3. Isolate whether the error occurs during a specific compaction trigger (e.g. hybrid log checkpoint, fold-over vs. snapshot compaction).
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    store.TakeHybridLogCheckpoint();
}
catch (NotImplementedException ex) when (ex.Message.Contains("GetRMWInitialFieldInfo"))
{
    logger.LogCritical("Compaction/checkpoint hit unsupported RMW initial path: {Message}", ex.Message);
    throw;
}

Prevention

When it happens

Trigger: Tsavorite's internal code path calls GetRMWInitialFieldInfo on a NoOpSessionFunctions session, indicating an RMW initial-update was attempted during compaction or iteration where NoOpSessionFunctions is the active functions implementation.

Common situations: Framework bug in compaction dispatch that enters an RMW initial path; custom checkpoint hooks triggering RMW operations during a NoOp session context.

Related errors


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