Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove back-compat support to loader <= 0.8 #1175

Merged
merged 2 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 0.14 Breaking Changes
- [Samples and chaincode have been renamed to examples and components respectively](##Samples-and-chaincode-have-been-renamed-to-examples-and-components-respectively)
- [Top-level `type` on `IClient` removed](#Top-level-type-on-IClient-removed)
- [Remove back-compat support for loader <= 0.8](#remove-back-compat-support-for-loader-0.8)

## Samples and chaincode have been renamed to examples and components respectively
The directories themselves have been renamed.
Expand All @@ -10,6 +11,11 @@ All path references in the dockerfile and json manifests have been updated along

The `type` field on `IClient` has been removed.

## Remove back-compat support for loader <= 0.8

Back-compat support code in ScheduleManager is removed for loader <= 0.8, which doesn't support group ops.
Any component based on runtime >= 0.14 will no longer work with loader <= 0.8

# 0.13 Breaking Changes

- [Fluid Packages Require Consumers on TypeScript `>=3.6`](##Fluid-Packages-Require-Consumers-on-TypeScript->=3.6)
Expand Down
25 changes: 3 additions & 22 deletions packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
IDeltaManager,
IDeltaSender,
ILoader,
IMessageScheduler,
IRuntime,
} from "@microsoft/fluid-container-definitions";
import {
Expand Down Expand Up @@ -148,8 +147,6 @@ interface IRuntimeMessageMetadata {
}

export class ScheduleManager {
private readonly messageScheduler: IMessageScheduler | undefined;
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
private readonly deltaScheduler: DeltaScheduler;
private pauseSequenceNumber: number | undefined;
private pauseClientId: string | undefined;
Expand All @@ -159,18 +156,10 @@ export class ScheduleManager {
private batchClientId: string;

constructor(
messageScheduler: IMessageScheduler | undefined,
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
private readonly emitter: EventEmitter,
legacyDeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
private readonly logger: ITelemetryLogger,
) {
if (!messageScheduler || !("toArray" in messageScheduler.deltaManager.inbound as any)) {
curtisman marked this conversation as resolved.
Show resolved Hide resolved
this.deltaManager = legacyDeltaManager;
return;
}

this.messageScheduler = messageScheduler;
this.deltaManager = this.messageScheduler.deltaManager;
this.deltaScheduler = new DeltaScheduler(
this.deltaManager,
ChildLogger.create(this.logger, "DeltaScheduler"),
Expand Down Expand Up @@ -217,13 +206,6 @@ export class ScheduleManager {
}

public beginOperation(message: ISequencedDocumentMessage) {
// If in legacy mode every operation is a batch
if (!this.messageScheduler) {
this.emitter.emit("batchBegin", message);
this.deltaScheduler.batchBegin();
return;
}

if (this.batchClientId !== message.clientId) {
// As a back stop for any bugs marking the end of a batch - if the client ID flipped, we
// consider the previous batch over.
Expand Down Expand Up @@ -252,7 +234,7 @@ export class ScheduleManager {
}

public endOperation(error: any | undefined, message: ISequencedDocumentMessage) {
if (!this.messageScheduler || error) {
if (error) {
this.batchClientId = undefined;
this.emitter.emit("batchEnd", error, message);
this.deltaScheduler.batchEnd();
Expand Down Expand Up @@ -588,9 +570,8 @@ export class ContainerRuntime extends EventEmitter implements IHostRuntime, IRun
this.logger = context.logger;

this.scheduleManager = new ScheduleManager(
context.IMessageScheduler,
context.IMessageScheduler.deltaManager,
this,
context.deltaManager,
ChildLogger.create(this.logger, "ScheduleManager"),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
ISequencedDocumentMessage,
MessageType,
} from "@microsoft/fluid-protocol-definitions";
import { IDeltaManager, IMessageScheduler } from "@microsoft/fluid-container-definitions";
import { MockDeltaManager, MockMessageScheduler } from "@microsoft/fluid-test-runtime-utils";
import { IDeltaManager } from "@microsoft/fluid-container-definitions";
import { MockDeltaManager } from "@microsoft/fluid-test-runtime-utils";
import { IConvertedSummaryResults, SummaryTreeConverter } from "../summaryTreeConverter";
import { ScheduleManager } from "../containerRuntime";

Expand Down Expand Up @@ -116,17 +116,14 @@ describe("Runtime", () => {
let batchEnd: number = 0;
let emitter: EventEmitter;
let deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
let messageScheduler: IMessageScheduler;
let scheduleManager: ScheduleManager;

beforeEach(() => {
emitter = new EventEmitter();
deltaManager = new MockDeltaManager();
messageScheduler = new MockMessageScheduler(deltaManager);
scheduleManager = new ScheduleManager(
messageScheduler,
emitter,
deltaManager,
emitter,
DebugLogger.create("fluid:testScheduleManager"),
);

Expand Down