Skip to content

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
@annielz annielz force-pushed the feat-fix-gc-objects branch from 70764e3 to 507463c Compare November 15, 2024 08:31
feat: re-organize size calc for disk store

feat: remove debug log

fix: pointer
@annielz annielz force-pushed the feat-fix-gc-objects branch from 7a3d8a0 to 02f6932 Compare November 18, 2024 04:01
@annielz annielz merged commit d5b6cd1 into develop Nov 21, 2024
11 checks passed
@annielz annielz deleted the feat-fix-gc-objects branch November 21, 2024 07:11
This was referenced Nov 22, 2024
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.

6 participants