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

feat: fix gc objects #1435

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

feat: fix gc objects #1435

wants to merge 6 commits into from

Conversation

annielz
Copy link
Collaborator

@annielz annielz commented Nov 14, 2024

Description

Currently in sp, if an object is deleted within the same tx as its local virtual group (lvg), the async GC Task will have issue finding its secondary sps, as this info is only available by using logic objectId -> lvg -> gvg -> secondary sps.

In this case, it used to be that the data in secondary sp's data storage will not be removed. Now updating logic for all sps to check for files that have prefix related to the object (as "e{objectid}_"), and remove all related files.

Rationale

Update logic of GC

Example

https://testnet.greenfieldscan.com/tx/0x2a34610146b15f60728e79b96181dc2af60825578822f70b913348b6cb8bed28
This link is an example of object & lvg in the same tx.

Changes

Notable changes:

  • GC Task
  • new data storage methods

Potential Impacts

  • GC Task

@annielz annielz changed the base branch from master to develop November 14, 2024 08:13
Copy link
Contributor

@constwz constwz left a comment

Choose a reason for hiding this comment

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

/LGTM

pieceKey = e.baseApp.PieceOp().SegmentPieceKey(objectInfo.Id.Uint64(), segIdx, objectVersion)
}
// ignore this delete api error, TODO: refine gc workflow by enrich metadata index.
deleteErr := e.baseApp.PieceStore().DeletePiece(ctx, pieceKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we we "DeletePiecesByPrefix" in this case as well?

Copy link

Choose a reason for hiding this comment

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

Done. Updated both primary sp & secondary sp's delete logic to batch delete pieces with object prefix.

@annielz annielz force-pushed the feat-fix-gc-objects branch 2 times, most recently from 2a6a3d1 to 70764e3 Compare November 15, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants