{"record":{"id":"452ac41294efbd05","repo":"microsoft/garnet","slug":"revivification-cannot-specify-revivifiablefraction","errorCode":null,"errorMessage":"Revivification cannot specify RevivifiableFraction without specifying bins.","messagePattern":"Revivification cannot specify RevivifiableFraction without specifying bins\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"libs/host/Configuration/Options.cs","lineNumber":819,"sourceCode":"            if (hasRecordCounts)\n            {\n                if (useRevivBinsPowerOf2)\n                    throw new Exception(\"Revivification cannot specify both record counts and powerof2 bins.\");\n                if (!hasRecordSizes)\n                    throw new Exception(\"Revivification bin counts require bin sizes.\");\n                useRevivBinsPowerOf2 = false;\n            }\n            if (RevivBinBestFitScanLimit != 0)\n            {\n                if (!hasRecordSizes && !enableRevivification)\n                    throw new Exception(\"Revivification cannot specify best fit scan limit without specifying bins.\");\n                if (RevivBinBestFitScanLimit < 0)\n                    throw new Exception(\"RevivBinBestFitScanLimit must be >= 0.\");\n            }\n            if (RevivifiableFraction != RevivificationSettings.DefaultRevivifiableFraction)\n            {\n                if (!hasRecordSizes && !enableRevivification)\n                    throw new Exception(\"Revivification cannot specify RevivifiableFraction without specifying bins.\");\n            }\n\n            // Warn users who explicitly opt into Scan compaction about the memory-spike cost.\n            // Scan builds a temporary parallel KV index proportional to the keyspace; Lookup is the recommended alternative.\n            if (CompactionType == LogCompactionType.Scan)\n            {\n                logger?.LogWarning(\"Compaction type Scan builds a temporary parallel KV index proportional to the keyspace, causing significant transient memory use. Use Lookup instead unless you have a specific reason for Scan.\");\n            }\n\n            if (SlowLogThreshold > 0)\n            {\n                if (SlowLogThreshold < 100)\n                    throw new Exception(\"SlowLogThreshold must be at least 100 microseconds.\");\n            }\n\n\n            if (!EnableAOF.GetValueOrDefault())\n            {","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/host/Configuration/Options.cs#L801-L837","documentation":"Generic Exception thrown during Options.Initialize revivification validation when RevivifiableFraction is changed from its default (DefaultRevivifiableFraction) but no bin scheme is configured (RevivBinRecordSizes is empty AND EnableRevivification is false). RevivifiableFraction controls what fraction of deleted records are eligible for revivification, which only has meaning when revivification bins exist.","triggerScenarios":"Setting RevivifiableFraction to a non-default value while revivification is effectively off (no explicit sizes and EnableRevivification false). Happens when revivification was disabled but the fraction setting was left customized.","commonSituations":"Disabling revivification without resetting RevivifiableFraction to its default; config overlay that customizes the fraction but also turns revivification off.","solutions":["If revivification is off, reset RevivifiableFraction to RevivificationSettings.DefaultRevivifiableFraction.","If you want a custom fraction, enable revivification (EnableRevivification=true) or provide explicit RevivBinRecordSizes."],"exampleFix":"// before\noptions.EnableRevivification = false;\noptions.RevivifiableFraction = 0.5;\n\n// after\noptions.EnableRevivification = false;\noptions.RevivifiableFraction = RevivificationSettings.DefaultRevivifiableFraction;","handlingStrategy":"validation","validationCode":"void ValidateFractionHasBins(double fraction, int[] sizes, bool enableReviv)\n{\n    if (fraction != RevivificationSettings.DefaultRevivifiableFraction && (sizes == null || sizes.Length == 0) && !enableReviv)\n        throw new InvalidOperationException(\"RevivifiableFraction requires a bin scheme (sizes or EnableRevivification).\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    options.Initialize(logger);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"RevivifiableFraction\"))\n{\n    logger.LogError(\"Revivification: RevivifiableFraction set but no bins configured.\");\n    throw;\n}","preventionTips":["When disabling revivification, reset RevivifiableFraction to the default value.","Treat all revivification sub-settings as a group — enable or disable together."],"tags":["config","revivification","validation","options","stale-config"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}