Skip to content
Open
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
14 changes: 14 additions & 0 deletions packages/programs/data/shared-log/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@ export class SharedLog<
key: PublicSignKey | string,
options?: { noEvent?: boolean },
) {
if (this.closed) return;

const keyHash = typeof key === "string" ? key : key.hashcode();
const deleted = await this.replicationIndex
.iterate({
Expand Down Expand Up @@ -3673,6 +3675,11 @@ export class SharedLog<
replicas: number;
prev?: EntryReplicated<R>;
}) {
if (this.closed) return;
if (!this.entryCoordinatesIndex) return;
if (!this._replicationRangeIndex) return;

try {
let assignedToRangeBoundary = shouldAssignToRangeBoundary(
properties.leaders,
properties.replicas,
Expand Down Expand Up @@ -3713,6 +3720,9 @@ export class SharedLog<
),
});
}
} catch (e: any) {
if (!this.closed) throw e;
}
}

private async deleteCoordinates(properties: { hash: string }) {
Expand Down Expand Up @@ -3918,6 +3928,8 @@ export class SharedLog<
topics: string[],
subscribed: boolean,
) {
if (this.closed) return;

if (!topics.includes(this.topic)) {
return;
}
Expand Down Expand Up @@ -4463,6 +4475,8 @@ export class SharedLog<
}

async rebalanceParticipation() {
if (this.closed) return false;

// update more participation rate to converge to the average expected rate or bounded by
// resources such as memory and or cpu

Expand Down
Loading