Fix complex object deletion #348

Merged
fyrchik merged 2 commits from dstepanov-yadro/frostfs-node:fix/complex_object_lifetime into master 2023-05-16 12:44:58 +00:00

To physically delete complex object we need parent with physical objects, not only parent.

Closes #332

To physically delete complex object we need parent with physical objects, not only parent. Closes #332
dstepanov-yadro force-pushed fix/complex_object_lifetime from 0c8f198e3e to 529bde2861 2023-05-15 09:12:15 +00:00 Compare
dstepanov-yadro force-pushed fix/complex_object_lifetime from 529bde2861 to 3e585c4176 2023-05-15 09:13:11 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2023-05-15 09:13:45 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-05-15 09:13:45 +00:00
dstepanov-yadro force-pushed fix/complex_object_lifetime from 3e585c4176 to 84694ad465 2023-05-15 09:14:23 +00:00 Compare
Collaborator

Please update CHANGELOG.

Please update CHANGELOG.
dstepanov-yadro force-pushed fix/complex_object_lifetime from 84694ad465 to 3bcd9f0fd5 2023-05-15 09:57:25 +00:00 Compare
Poster
Collaborator

Please update CHANGELOG.

Done

> Please update CHANGELOG. Done
aarifullin approved these changes 2023-05-15 11:04:37 +00:00
aarifullin left a comment
Collaborator

LGTM

LGTM
ale64bit reviewed 2023-05-15 12:14:05 +00:00
@ -0,0 +25,4 @@
}
result[addr] = []oid.Address{}
bkt := tx.Bucket(parentBucketName(addr.Container(), buffer[:]))
Collaborator

why the slicing ([:]) here? it's already a slice.

why the slicing (`[:]`) here? it's already a slice.
Poster
Collaborator

fixed

fixed
ale64bit marked this conversation as resolved
@ -0,0 +35,4 @@
return err
}
if len(binObjIDs) == 0 {
Collaborator

why the check? the next loop won't do anything anyway.

why the check? the next loop won't do anything anyway.
Poster
Collaborator

done

done
ale64bit marked this conversation as resolved
@ -115,6 +75,8 @@ func Test_GCDropsLockedExpiredObject(t *testing.T) {
epoch.Value = 105
sh.NotificationChannel() <- shard.EventNewEpoch(epoch.Value)
time.Sleep(1 * time.Second) //wait GC completes
Collaborator

this is unfortunate...isn't there another way? (same below)

this is unfortunate...isn't there another way? (same below)
Poster
Collaborator

Looks ugly, I agree. But there are two async processes: one for expired objects collecting, second for physically delete expired objects.

Looks ugly, I agree. But there are two async processes: one for expired objects collecting, second for physically delete expired objects.
Collaborator

I'm not sure what to do about it, but it would be nice to look at it some other time.

I'm not sure what to do about it, but it would be nice to look at it some other time.
ale64bit marked this conversation as resolved
@ -125,0 +180,4 @@
}, 3*time.Second, 1*time.Second, "expired complex object must be deleted on epoch after lock expires")
}
func createAndInitGCTestShard(t *testing.T, epoch *epochState) *shard.Shard {
Collaborator
we have already some very similar functionality. Can we avoid the duping? https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/local_object_storage/shard/shard_test.go#L36
Poster
Collaborator

done

done
ale64bit marked this conversation as resolved
dstepanov-yadro force-pushed fix/complex_object_lifetime from 3bcd9f0fd5 to a0a9455fec 2023-05-15 12:51:50 +00:00 Compare
ale64bit approved these changes 2023-05-15 16:31:03 +00:00
acid-ant approved these changes 2023-05-16 06:35:34 +00:00
fyrchik reviewed 2023-05-16 08:22:27 +00:00
@ -115,6 +65,8 @@ func Test_GCDropsLockedExpiredObject(t *testing.T) {
epoch.Value = 105
sh.NotificationChannel() <- shard.EventNewEpoch(epoch.Value)
time.Sleep(1 * time.Second) //wait GC completes

Can we do it more reliably? It will break at some point, e.g. with -race flag on CI.

Can we do it more reliably? It will break at some point, e.g. with -race flag on CI.
Poster
Collaborator

It will be too hard. First we need to wait expired objects collection completes. Then we need to wait GC completed.

It will be too hard. First we need to wait expired objects collection completes. Then we need to wait GC completed.
Poster
Collaborator

just dropped this wait

just dropped this wait
fyrchik marked this conversation as resolved
@ -34,3 +39,3 @@
}
func newCustomShard(t testing.TB, rootPath string, enableWriteCache bool, wcOpts []writecache.Option, bsOpts []blobstor.Option) *shard.Shard {
func newCustomShard(t testing.TB, rootPath string, enableWriteCache bool, wcOpts []writecache.Option, bsOpts []blobstor.Option,

We already have options for writecache and blobstor. What about also having options for a metabase instead?

We already have options for writecache and blobstor. What about also having options for a metabase instead?
Poster
Collaborator

fixed

fixed
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed fix/complex_object_lifetime from a0a9455fec to 107b6b8780 2023-05-16 08:49:17 +00:00 Compare
dstepanov-yadro force-pushed fix/complex_object_lifetime from 107b6b8780 to 76ee54fddb 2023-05-16 08:51:57 +00:00 Compare
fyrchik approved these changes 2023-05-16 12:44:44 +00:00
fyrchik merged commit 869fcbf591 into master 2023-05-16 12:44:58 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#348
There is no content yet.