{"record":{"id":"f42978bc2a606ee8","repo":"dotnet/orleans","slug":"storage-state-corrupted-no-record-for-committed-s","errorCode":null,"errorMessage":"Storage state corrupted: no record for committed state v{this.key.CommittedSequenceId}","messagePattern":"Storage state corrupted: no record for committed state v(.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/AWS/Orleans.Transactions.DynamoDB/TransactionalState/DynamoDBTransactionalStateStorage.cs","lineNumber":89,"sourceCode":"                LogDebugLoadedV0Fresh(this.partitionKey);\n                this.requiresReload = false;\n\n                // first time load\n                return new TransactionalStorageLoadResponse<TState>();\n            }\n\n            TState committedState;\n            if (this.key.CommittedSequenceId == 0)\n            {\n                committedState = new TState();\n            }\n            else\n            {\n                if (!this.FindState(this.key.CommittedSequenceId, out var pos))\n                {\n                    var error = $\"Storage state corrupted: no record for committed state v{this.key.CommittedSequenceId}\";\n                    LogCriticalPartitionError(this.partitionKey, error);\n                    throw new InvalidOperationException(error);\n                }\n\n                committedState = this.ConvertFromStorageFormat<TState>(states[pos].Value);\n            }\n\n            var PrepareRecordsToRecover = new List<PendingTransactionState<TState>>();\n            for (int i = 0; i < states.Count; i++)\n            {\n                var kvp = states[i];\n\n                // pending states for already committed transactions can be ignored\n                if (kvp.Key <= key.CommittedSequenceId)\n                    continue;\n\n                // upon recovery, local non-committed transactions are considered aborted\n                if (kvp.Value.TransactionManager is null or { Length: 0 })\n                    break;\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Transactions.DynamoDB/TransactionalState/DynamoDBTransactionalStateStorage.cs#L71-L107","documentation":"Thrown during DynamoDBTransactionalStateStorage.Load when key.CommittedSequenceId is non-zero but no matching state record exists in the loaded states list (FindState returns false). This indicates the persisted metadata points at a committed version that has no corresponding row, i.e., the transaction state table is inconsistent/corrupted for this partition. The provider logs a critical partition error before throwing InvalidOperationException.","triggerScenarios":"Manual deletion or truncation of rows in the transaction state DynamoDB table; partial writes that committed metadata without the associated state entity; a failed/aborted migration; schema/version drift where older rows are missing; bugs in an upstream transaction layer leaving dangling CommittedSequenceId.","commonSituations":"Operator deleted DynamoDB items outside Orleans; table restored from a non-transactionally-consistent backup/point-in-time that split metadata and state rows; cross-version upgrade where the storage format changed and old rows were dropped; concurrent tools writing to the same table.","solutions":["Restore the missing state row(s) for the committed sequence id from a consistent backup.","If recovery is impossible, reset/clear the affected grain's transaction state (accept data loss) and let it reinitialize from v0.","Stop all out-of-band processes that mutate the Orleans transaction state table.","Verify backups are taken with DynamoDB point-in-time or on-demand backups that preserve cross-row consistency.","File/examine an Orleans issue if this occurs without external tampering on a supported version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { var resp = await store.Load(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Storage state corrupted\"))\n{\n    logger.LogCritical(ex, \"Transaction state for partition {Key} is corrupted.\", partitionKey);\n    // escalate: quarantine the grain / restore from backup / reset state\n    throw;\n}","preventionTips":["Never mutate the Orleans transaction state table out-of-band.","Use DynamoDB point-in-time backups for cross-row consistency.","Validate table integrity after any cross-version migration.","Stop external tools from writing to the storage table."],"tags":["aws","dynamodb","transactions","data-corruption","orleans","storage"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}