{"record":{"id":"ca4d7094188b8ab2","repo":"microsoft/garnet","slug":"getrmwinitialfieldinfo-is-not-supported-in-this-is","errorCode":null,"errorMessage":"GetRMWInitialFieldInfo is not supported in this ISessionFunctions implementation","messagePattern":"GetRMWInitialFieldInfo is not supported in this ISessionFunctions implementation","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"libs/storage/Tsavorite/cs/src/core/ClientSession/NoOpSessionFunctions.cs","lineNumber":82,"sourceCode":"            => true;\n\n        public readonly bool NeedCopyUpdate<TSourceLogRecord>(in TSourceLogRecord srcLogRecord, ref TInput input, ref TOutput output, ref RMWInfo rmwInfo)\n            where TSourceLogRecord : ISourceLogRecord\n            => true;\n\n        public readonly void ReadCompletionCallback(ref DiskLogRecord diskLogRecord, ref TInput input, ref TOutput output, TContext ctx, Status status, RecordMetadata recordMetadata) { }\n\n        public readonly void RMWCompletionCallback(ref DiskLogRecord diskLogRecord, ref TInput input, ref TOutput output, TContext ctx, Status status, RecordMetadata recordMetadata) { }\n\n        public readonly RecordFieldInfo GetRMWModifiedFieldInfo<TSourceLogRecord>(in TSourceLogRecord srcLogRecord, ref TInput input)\n            where TSourceLogRecord : ISourceLogRecord\n             => throw new NotImplementedException(\"GetRMWModifiedFieldInfo is not supported in this ISessionFunctions implementation\");\n        public readonly RecordFieldInfo GetRMWInitialFieldInfo<TKey>(TKey key, ref TInput input)\n            where TKey : IKey\n#if NET9_0_OR_GREATER\n                , allows ref struct\n#endif\n            => throw new NotImplementedException(\"GetRMWInitialFieldInfo is not supported in this ISessionFunctions implementation\");\n        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey>(TKey key, ReadOnlySpan<byte> value, ref TInput input)\n            where TKey : IKey\n#if NET9_0_OR_GREATER\n                , allows ref struct\n#endif\n            => throw new NotImplementedException(\"GetUpsertFieldInfo(ReadOnlySpan<byte> value) is not supported in this ISessionFunctions implementation\");\n        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey>(TKey key, IHeapObject value, ref TInput input)\n            where TKey : IKey\n#if NET9_0_OR_GREATER\n                , allows ref struct\n#endif\n            => throw new NotImplementedException(\"IHeapObject value) is not supported in this ISessionFunctions implementation\");\n        public readonly RecordFieldInfo GetUpsertFieldInfo<TKey, TSourceLogRecord>(TKey key, in TSourceLogRecord inputLogRecord, ref TInput input)\n            where TKey : IKey\n#if NET9_0_OR_GREATER\n                , allows ref struct\n#endif\n            where TSourceLogRecord : ISourceLogRecord","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/storage/Tsavorite/cs/src/core/ClientSession/NoOpSessionFunctions.cs#L64-L100","documentation":"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.","triggerScenarios":"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.","commonSituations":"Framework bug in compaction dispatch that enters an RMW initial path; custom checkpoint hooks triggering RMW operations during a NoOp session context.","solutions":["Report as a Tsavorite framework bug — compaction contexts using NoOpSessionFunctions should not trigger RMW initial operations.","If writing custom ISessionFunctions, implement GetRMWInitialFieldInfo to compute key and value sizes for RMW-created records.","Isolate whether the error occurs during a specific compaction trigger (e.g. hybrid log checkpoint, fold-over vs. snapshot compaction)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    store.TakeHybridLogCheckpoint();\n}\ncatch (NotImplementedException ex) when (ex.Message.Contains(\"GetRMWInitialFieldInfo\"))\n{\n    logger.LogCritical(\"Compaction/checkpoint hit unsupported RMW initial path: {Message}\", ex.Message);\n    throw;\n}","preventionTips":["Framework-internal error — RMW initial path should not be hit during compaction. Report upstream.","Implement GetRMWInitialFieldInfo in custom ISessionFunctions to return correct RecordFieldInfo.","Run compaction tests that cover both existing-key and new-key RMW scenarios."],"tags":["tsavorite","compaction","session-functions","rmw","field-info","initial-update","not-implemented","internal","csharp"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}