Skip to content

Commit 2e4e9b2

Browse files
[GC] Removed throwOnInactiveLoad GC option and the config to disable autorecovery (#22107)
Removed the following: - `throwOnInactiveLoad` GC container runtime option and `throwOnInactiveLoad` internal GC config - These were for a feature to thrown an error when an inactive data store is loaded. This was an experimental feature added during sweep development. However, it was never used. - `"Fluid.GarbageCollection.DisableAutoRecovery"` feature config and `tombstoneAutorecoveryEnabled` internal GC config - These were added while shipping auto recovery feature to turn it off in case it caused issues. This has been enabled for a while and we want it to always be on if a tombstone data store is loaded.
1 parent 9298dcf commit 2e4e9b2

File tree

17 files changed

+38
-729
lines changed

17 files changed

+38
-729
lines changed

.changeset/ready-windows-switch.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@fluidframework/container-runtime": minor
3+
---
4+
---
5+
section: deprecation
6+
---
7+
8+
InactiveResponseHeaderKey header is deprecated
9+
10+
The header `InactiveResponseHeaderKey` is deprecated and will be removed in the future. It was part of an experimental feature where loading an inactive data store would result in returning a 404 with this header set to true. This feature is no longer supported.

packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export interface INackSummaryResult {
490490
readonly summaryNackOp: ISummaryNackMessage;
491491
}
492492

493-
// @alpha
493+
// @alpha @deprecated
494494
export const InactiveResponseHeaderKey = "isInactive";
495495

496496
// @alpha (undocumented)

packages/runtime/container-runtime/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@
230230
"typescript": "~5.4.5"
231231
},
232232
"typeValidation": {
233-
"broken": {}
233+
"broken": {
234+
"RemovedVariable_AllowInactiveRequestHeaderKey": {
235+
"backCompat": false
236+
}
237+
}
234238
}
235239
}

packages/runtime/container-runtime/src/channelCollection.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ export enum RuntimeHeaders {
119119
* @alpha
120120
*/
121121
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
122-
/**
123-
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
124-
* @internal
125-
*/
126-
export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
127122

128123
type PendingAliasResolve = (success: boolean) => void;
129124

@@ -1460,14 +1455,10 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
14601455
if (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === "boolean") {
14611456
headerData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];
14621457
}
1463-
if (typeof request.headers?.[AllowInactiveRequestHeaderKey] === "boolean") {
1464-
headerData.allowInactive = request.headers[AllowInactiveRequestHeaderKey];
1465-
}
14661458

1467-
// We allow Tombstone/Inactive requests for sub-DataStore objects
1459+
// We allow Tombstone requests for sub-DataStore objects
14681460
if (requestForChild) {
14691461
headerData.allowTombstone = true;
1470-
headerData.allowInactive = true;
14711462
}
14721463

14731464
await this.waitIfPendingAlias(id);

packages/runtime/container-runtime/src/containerRuntime.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ export const TombstoneResponseHeaderKey = "isTombstoned";
523523
* Inactive error responses will have this header set to true
524524
* @legacy
525525
* @alpha
526+
*
527+
* @deprecated this header is deprecated and will be removed in the future. The functionality corresponding
528+
* to this was experimental and is no longer supported.
526529
*/
527530
export const InactiveResponseHeaderKey = "isInactive";
528531

@@ -534,15 +537,13 @@ export interface RuntimeHeaderData {
534537
wait?: boolean;
535538
viaHandle?: boolean;
536539
allowTombstone?: boolean;
537-
allowInactive?: boolean;
538540
}
539541

540542
/** Default values for Runtime Headers */
541543
export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
542544
wait: true,
543545
viaHandle: false,
544546
allowTombstone: false,
545-
allowInactive: false,
546547
};
547548

548549
/**

packages/runtime/container-runtime/src/gc/garbageCollection.ts

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from "@fluidframework/telemetry-utils/internal";
2828

2929
import { blobManagerBasePath } from "../blobManager/index.js";
30-
import { InactiveResponseHeaderKey, TombstoneResponseHeaderKey } from "../containerRuntime.js";
30+
import { TombstoneResponseHeaderKey } from "../containerRuntime.js";
3131
import { ClientSessionExpiredError } from "../error.js";
3232
import { ContainerMessageType, ContainerRuntimeGCMessage } from "../messageTypes.js";
3333
import { IRefreshSummaryResult } from "../summary/index.js";
@@ -47,7 +47,6 @@ import {
4747
IMarkPhaseStats,
4848
ISweepPhaseStats,
4949
UnreferencedState,
50-
disableAutoRecoveryKey,
5150
type IGCNodeUpdatedProps,
5251
} from "./gcDefinitions.js";
5352
import {
@@ -883,13 +882,6 @@ export class GarbageCollector implements IGarbageCollector {
883882
break;
884883
}
885884
case GarbageCollectionMessageType.TombstoneLoaded: {
886-
if (
887-
!this.configs.tombstoneAutorecoveryEnabled ||
888-
this.mc.config.getBoolean(disableAutoRecoveryKey) === true
889-
) {
890-
break;
891-
}
892-
893885
// Mark the node as referenced to ensure it isn't Swept
894886
const tombstonedNodePath = message.contents.nodePath;
895887
this.addedOutboundReference(
@@ -985,8 +977,6 @@ export class GarbageCollector implements IGarbageCollector {
985977
// trackedId will be either DataStore or Blob ID (not sub-DataStore ID, since some of those are unrecognized by GC)
986978
const trackedId = node.path;
987979
const isTombstoned = this.tombstones.includes(trackedId);
988-
const isInactive = this.unreferencedNodesState.get(trackedId)?.state === "Inactive";
989-
990980
const fullPath = request !== undefined ? urlToGCNodePath(request.url) : trackedId;
991981

992982
// This will log if appropriate
@@ -1037,22 +1027,6 @@ export class GarbageCollector implements IGarbageCollector {
10371027
errorRequest,
10381028
);
10391029
}
1040-
1041-
// If the object is inactive and inactive enforcement is configured, throw an error.
1042-
if (isInactive) {
1043-
const shouldThrowOnInactiveLoad =
1044-
!this.isSummarizerClient &&
1045-
this.configs.throwOnInactiveLoad === true &&
1046-
headerData?.allowInactive !== true;
1047-
if (shouldThrowOnInactiveLoad) {
1048-
throw responseToException(
1049-
createResponseError(404, `${nodeType} is inactive`, errorRequest, {
1050-
[InactiveResponseHeaderKey]: true,
1051-
}),
1052-
errorRequest,
1053-
);
1054-
}
1055-
}
10561030
}
10571031

10581032
/**
@@ -1065,10 +1039,9 @@ export class GarbageCollector implements IGarbageCollector {
10651039
* before runnint GC next.
10661040
*/
10671041
private triggerAutoRecovery(nodePath: string) {
1068-
if (
1069-
!this.configs.tombstoneAutorecoveryEnabled ||
1070-
this.mc.config.getBoolean(disableAutoRecoveryKey) === true
1071-
) {
1042+
// If sweep isn't enabled, auto-recovery isn't needed since its purpose is to prevent this object from being
1043+
// deleted. It also would end up sending a GC op which can break clients running FF version 1.x.
1044+
if (!this.configs.sweepEnabled) {
10721045
return;
10731046
}
10741047

packages/runtime/container-runtime/src/gc/gcConfigs.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ export function generateGCConfigs(
115115
? false
116116
: sweepAllowed && createParams.gcOptions.enableGCSweep === true;
117117

118-
// If we aren't running sweep, also disable AutoRecovery which also emits the GC op.
119-
// This gives a simple control surface for compatibility concerns around introducing the new op.
120-
const tombstoneAutorecoveryEnabled = sweepEnabled;
121-
122118
// Override inactive timeout if test config or gc options to override it is set.
123119
const inactiveTimeoutMs =
124120
mc.config.getNumber("Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs") ??
@@ -141,7 +137,6 @@ export function generateGCConfigs(
141137
sweepGracePeriodMs,
142138
});
143139

144-
const throwOnInactiveLoad: boolean | undefined = createParams.gcOptions.throwOnInactiveLoad;
145140
const throwOnTombstoneLoad =
146141
mc.config.getBoolean(disableThrowOnTombstoneLoadKey) !== true &&
147142
sweepEnabled &&
@@ -151,7 +146,6 @@ export function generateGCConfigs(
151146
gcAllowed, // For this document
152147
sweepAllowed, // For this document
153148
sweepEnabled, // For this session
154-
tombstoneAutorecoveryEnabled,
155149
runFullGC,
156150
testMode,
157151
sessionExpiryTimeoutMs,
@@ -161,7 +155,6 @@ export function generateGCConfigs(
161155
persistedGcFeatureMatrix,
162156
gcVersionInBaseSnapshot,
163157
gcVersionInEffect: getGCVersionInEffect(mc.config),
164-
throwOnInactiveLoad,
165158
throwOnTombstoneLoad,
166159
};
167160
}

packages/runtime/container-runtime/src/gc/gcDefinitions.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ export const disableThrowOnTombstoneLoadKey =
5959
"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad";
6060
/** Config key to enable GC version upgrade. */
6161
export const gcVersionUpgradeToV4Key = "Fluid.GarbageCollection.GCVersionUpgradeToV4";
62-
/** Config key to disable auto-recovery mechanism that protects Tombstones that are loaded from being swept (use true) */
63-
export const disableAutoRecoveryKey = "Fluid.GarbageCollection.DisableAutoRecovery";
6462

6563
// One day in milliseconds.
6664
export const oneDayMs = 1 * 24 * 60 * 60 * 1000;
@@ -465,8 +463,6 @@ export interface IGarbageCollectorConfigs {
465463
readonly sweepAllowed: boolean;
466464
/** Tracks if sweep phase is enabled to run in this session or not */
467465
readonly sweepEnabled: boolean;
468-
/** Is Tombstone AutoRecovery enabled? Useful for preventing the GC "TombstoneLoaded" op, for compatibility reasons */
469-
readonly tombstoneAutorecoveryEnabled: boolean;
470466
/**
471467
* If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.
472468
*/
@@ -490,8 +486,6 @@ export interface IGarbageCollectorConfigs {
490486
readonly gcVersionInBaseSnapshot: GCVersion | undefined;
491487
/** The current version of GC data in the running code */
492488
readonly gcVersionInEffect: GCVersion;
493-
/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
494-
readonly throwOnInactiveLoad: boolean | undefined;
495489
/** If true, throw an error when a tombstone data store is retrieved */
496490
readonly throwOnTombstoneLoad: boolean;
497491
}

packages/runtime/container-runtime/src/gc/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export {
3030
oneDayMs,
3131
runSessionExpiryKey,
3232
stableGCVersion,
33-
disableAutoRecoveryKey,
3433
UnreferencedState,
3534
disableThrowOnTombstoneLoadKey,
3635
GarbageCollectionMessage,

packages/runtime/container-runtime/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export {
3737
RuntimeHeaders,
3838
ChannelCollectionFactory,
3939
AllowTombstoneRequestHeaderKey,
40-
AllowInactiveRequestHeaderKey,
4140
} from "./channelCollection.js";
4241
export {
4342
GCNodeType,

0 commit comments

Comments
 (0)