-
Notifications
You must be signed in to change notification settings - Fork 41
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
base: develop
Are you sure you want to change the base?
feat: fix gc objects #1435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
modular/executor/execute_gc.go
Outdated
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
2a6a3d1
to
70764e3
Compare
feat: lint feat: lint
70764e3
to
507463c
Compare
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:
Potential Impacts