Skip to content

Commit

Permalink
[AFR Ask] Send the reason when making getDeltas calls (#22821)
Browse files Browse the repository at this point in the history
Fixes:
[AB#6959](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/6959)

## Description
Yang Gao to detail the specifics and data/incident information in the
Feature Description

Optimize getDelta / internal service calls to reduce load on Alfred &
Riddler and minimize impact on customer traffic

FRS has observed some unexpected getDeltas calls. If the client can send
FRS the reasons why the calls were made, it can greatly help the
investigations. One example is that we have seen some getDeltas calls
trying to read very old ops, which were generated tens of days ago, and
it's hard for us to understand what triggered these calls.

## Reviewer Guidance

Let me know if there's a better way to send the reason to AFR.
  • Loading branch information
MarioJGMsoft authored Nov 8, 2024
1 parent 04a3314 commit 935c7e7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ export class DocumentDeltaStorageService implements IDocumentDeltaStorageService
this.snapshotOps = undefined;
}

const ops = await this.deltaStorageService.get(this.tenantId, this.id, from, to);
const ops = await this.deltaStorageService.get(
this.tenantId,
this.id,
from,
to,
fetchReason,
);
validateMessages("storage", ops.messages, from, this.logger, false /* strict */);
opsFromStorage += ops.messages.length;
return ops;
Expand Down Expand Up @@ -144,6 +150,7 @@ export class DeltaStorageService implements IDeltaStorageService {
id: string,
from: number, // inclusive
to: number, // exclusive
fetchReason?: string,
): Promise<IDeltasFetchResult> {
const ops = await PerformanceEvent.timedExecAsync(
this.logger,
Expand All @@ -158,6 +165,7 @@ export class DeltaStorageService implements IDeltaStorageService {
const response = await restWrapper.get<ISequencedDocumentMessage[]>(url, {
from: from - 1,
to,
fetchReason: fetchReason ?? "",
});
event.end({
length: response.content.length,
Expand Down

0 comments on commit 935c7e7

Please sign in to comment.