Skip to content

GC: Tombstone for blobs#12880

Closed
tyler-cai-microsoft wants to merge 18 commits intomicrosoft:mainfrom
tyler-cai-microsoft:tombstoneBlobs
Closed

GC: Tombstone for blobs#12880
tyler-cai-microsoft wants to merge 18 commits intomicrosoft:mainfrom
tyler-cai-microsoft:tombstoneBlobs

Conversation

@tyler-cai-microsoft
Copy link
Copy Markdown
Contributor

Tombstone for GC Blobs

Done when

  • Mark as tombstone
  • Prevents handles/requests from getting tombstoned blobs
  • can untombstone

@github-actions github-actions Bot added area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch labels Nov 10, 2022
@github-actions github-actions Bot added area: build Build related issues area: dds Issues related to distributed data structures area: dds: propertydds area: dds: sharedstring area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: odsp-driver area: server Server related issues (routerlicious) breaking change This PR or issue would introduce a breaking change dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation public api change Changes to a public API labels Nov 18, 2022
@github-actions
Copy link
Copy Markdown
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluidframework-docs@0.25.0 linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> npm run linkcheck:fast -- --external


> fluidframework-docs@0.25.0 linkcheck:fast /home/runner/work/FluidFramework/FluidFramework/docs
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt "--external"

Crawling...

http://localhost:1313/css/style.min.882abef0cf4d5438897263d06a89616ce369514241de0a09692f026c97a3b939.css
- (1:1031) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.svg (HTTP 503)
- (1:1184) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.eot (HTTP 503)
- (1:1272) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.eot? (HTTP 503)
- (1:1740) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.svg (HTTP 503)
- (1:2427) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.svg (HTTP 503)
- (1:3130) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.svg (HTTP 503)
- (1:3286) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.eot (HTTP 503)
- (1:3811) url(...) => https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.svg (HTTP 503)

http://localhost:1313/docs/apis/core-interfaces/ifluidcodedetailscomparer-interface
- (865:360) 'Array.sort' => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description (HTTP 200 but missing anchor)
- (876:168) 'https://..' => https://github.com/npm/node-semver#usage (HTTP 200 but missing anchor)
- (884:25) 'Array.sort' => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description (HTTP 200 but missing anchor)
- (930:25) 'https://..' => https://github.com/npm/node-semver#usage (HTTP 200 but missing anchor)

http://localhost:1313/docs/apis/core-interfaces/ifluidcodedetailscomparer-interface/
- (865:360) 'Array.sort' => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description (HTTP 200 but missing anchor)
- (876:168) 'https://..' => https://github.com/npm/node-semver#usage (HTTP 200 but missing anchor)
- (884:25) 'Array.sort' => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description (HTTP 200 but missing anchor)
- (930:25) 'https://..' => https://github.com/npm/node-semver#usage (HTTP 200 but missing anchor)

http://localhost:1313/docs/apis/task-manager/taskmanager-class
- (838:52) 'https://..' => https://fluidframework.com/docs/data-structures/task-manager/%29 (HTTP 404)

http://localhost:1313/docs/apis/task-manager/taskmanager-class/
- (838:52) 'https://..' => https://fluidframework.com/docs/data-structures/task-manager/%29 (HTTP 404)

http://localhost:1313/docs/start/examples/
- (877:5) 'Using Fl..' => https://learn.microsoft.com/microsoftteams/platform/tabs/using-fluid-msteam (HTTP 301 => 404)
  - redirect path:
    - https://learn.microsoft.com/microsoftteams/platform/tabs/using-fluid-msteam (301)
    - /en-us/microsoftteams/platform/tabs/using-fluid-msteam (404)


Stats:
  113737 links
    1227 destination URLs
       2 URLs ignored
       8 warnings
      10 errors


@github-actions github-actions Bot removed area: dev experience Improving the experience of devs building on top of fluid area: loader Loader related issues area: driver Driver related issues area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: dds: sharedstring labels Nov 21, 2022
@tyler-cai-microsoft tyler-cai-microsoft requested a review from a team as a code owner November 21, 2022 20:54
Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
// GC tombstones these blobs
if (tombstone) {
this.tombstonedBlobs.add(blobId);
continue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the continue statements from both these blocks are there is no code after this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you can keep this continue and remove the else if block.

if (tombstone) {
this.tombstonedBlobs.add(blobId);
continue;
} else if (this.redirectTable?.has(blobId)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not needed actually. You can directly call this.redirectTable.delete(blobId). The code is this way because of some changes that happened with blob manager.

Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
Comment thread packages/runtime/container-runtime/src/containerRuntime.ts Outdated
Comment thread packages/runtime/container-runtime/src/blobManager.ts Outdated
Comment thread packages/runtime/container-runtime/src/containerRuntime.ts Outdated
const fluidHandleContext = defaultDataObject._context.containerRuntime.IFluidHandleContext;

// Handle requests for blob handle should fail!
const response = await fluidHandleContext.resolveHandle({ url: absolutePath });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should get the blob via its handle not via request / resolveHandle because that is what will happen in real scenarios.
This is fine to keep too but getting from handle is important as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to have to create a handle or something because there's no way of getting the handle from the container as the blob doesn't exist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have a handle and can return it from summarizationWithUnreferencedBlobAfterTime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? The blob handle that I have on the creation container is on a container that doesn't load the blob as tombstoned/unreferenced.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. I didn't look into detail and assumed that it's the same container.

Comment thread packages/test/test-end-to-end-tests/src/test/gc/gcTombstoneBlobs.spec.ts Outdated
});

// If this test starts failing due to runtime is closed errors try first adjusting `sweepTimeoutMs` above
itExpects("Handle request for tombstoned blobs only logs in summarizing container loaded after sweep timeout",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is also testing non-summarizer container. Also, its testing that with the ThrowOnTombstoneUsage set to false, there is no error thrown.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a third test case which validates that on summarizer container, no error is thrown even with the ThrowOnTombstoneUsage setting enabled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summarizing container would close if we ThrowOnTombstoneUsage. So it's indirectly tested here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure but you should fix the test names to reflect what they are testing. Having an explicit test for summarizer container would be useful too. Also, summarizer container should not close (you said would).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add an extra test here, I originally thought adding another test would be redundant since it's already indirectly tested.

import { delay, stringToBuffer } from "@fluidframework/common-utils";
import { LoaderHeader } from "@fluidframework/container-definitions";

describeNoCompat("GC tombstone blob tests", (getTestObjectProvider) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There tests won't be enough. Attachment blobs have different behavior based on whether they were loaded during detached or attached state. Also, blobs can be de-duped which adds to the mix.
See

describeNoCompat("Garbage collection of blobs", (getTestObjectProvider) => {
for these tests. Maybe just run the same scenarios with tombstones enabled.

@agarwal-navin
Copy link
Copy Markdown
Contributor

Closing in favor of #13266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants