Simple object with lock and expiration time not removed after locks are expired #145

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:bug/OBJECT-2279 into master 2023-07-26 21:07:56 +00:00

Let say we have:

Current epoch is 100
Simple object with NEOFSEXPIRATIONEPOCH=101
Simple object is locked with lock until epoch 103

Steps:
Tick epochs until current epoch = 103
Check object availability

Expected Behavior
Simple object should be removed since locks are gone and object expired

Current Behavior
Simple object continues to present in storage even if we wait additional extra epochs

**Let say we have:** Current epoch is 100 Simple object with NEOFSEXPIRATIONEPOCH=101 Simple object is locked with lock until epoch 103 **Steps:** Tick epochs until current epoch = 103 Check object availability **Expected Behavior** Simple object should be removed since locks are gone and object expired **Current Behavior** Simple object continues to present in storage even if we wait additional extra epochs
dstepanov-yadro force-pushed bug/OBJECT-2279 from 705aad7370 to 699485924e 2023-03-17 08:40:48 +00:00 Compare
dstepanov-yadro changed title from WIP: Simple object with lock and expiration time not removed after locks are expired to Simple object with lock and expiration time not removed after locks are expired 2023-03-17 08:41:10 +00:00
dstepanov-yadro requested review from storage-core-committers 2023-03-17 08:41:21 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-03-17 08:41:21 +00:00
fyrchik reviewed 2023-03-20 13:15:44 +00:00
@ -121,1 +120,3 @@
removerSleepInterval time.Duration
removerBatchSize int
removerSleepInterval time.Duration
expiredCollectorBatchSize int
Owner

With many params our system will be harder to configure (the process of fine-tuning and determining what the best value is is too slow and error-prone). We already have many complex dependencies between parameter values and system behaviour.

Can we just take the same batch size? Do we have a reason, why should they be different?

With many params our system will be harder to configure (the process of fine-tuning and determining what _the best_ value is is too slow and error-prone). We already have many complex dependencies between parameter values and system behaviour. Can we just take the same batch size? Do we have a reason, why should they be different?
Author
Member

removerBatchSize is batch size for removing objects.

expiredCollectorBatchSize is batch size for marking objects expired.

These parameters relate to different processes. In the case of one parameter, we will create another complex dependency.

```removerBatchSize``` is batch size for removing objects. ```expiredCollectorBatchSize``` is batch size for marking objects expired. These parameters relate to different processes. In the case of one parameter, we will create another complex dependency.
fyrchik marked this conversation as resolved
@ -122,0 +120,4 @@
removerBatchSize int
removerSleepInterval time.Duration
expiredCollectorBatchSize int
expiredCollectorWorkersCount int
Owner

Don't forget to update docs/storage-node-configuration.md.

Don't forget to update `docs/storage-node-configuration.md`.
Author
Member

Done.

Done.
fyrchik marked this conversation as resolved
@ -242,0 +268,4 @@
errGroup, egCtx := errgroup.WithContext(ctx)
errGroup.SetLimit(workersCount)
errGroup.Go(func() error {
Owner

Why do we need a goroutine here?

Why do we need a goroutine here?
Author
Member

If s.getExpiredObjects fails with an error then all other goroutines executing s.handleExpiredObjects will be cancelled by egCtx, and vice versa. It is possible to write code without this goroutine, but code will be much more tricky.

If ```s.getExpiredObjects``` fails with an error then all other goroutines executing ```s.handleExpiredObjects``` will be cancelled by ```egCtx```, and vice versa. It is possible to write code without this goroutine, but code will be much more tricky.
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed bug/OBJECT-2279 from 699485924e to acf79b8425 2023-03-21 06:44:22 +00:00 Compare
fyrchik approved these changes 2023-03-21 07:55:33 +00:00
@ -237,0 +248,4 @@
s.collectExpiredObjects(ctx, e)
}
func (s *Shard) getExpiredObjectsParameters() (workersCount, batchSize int) {
Owner

Why not doing it once on init?

Why not doing it once on init?
Author
Member
  1. source code looks simpler when variable initialization is near variable usage. getExpiredObjectsParameters() doesn't look hard to run.
  2. it will be easier to support sighup for gc parameters.
1. source code looks simpler when variable initialization is near variable usage. ```getExpiredObjectsParameters()``` doesn't look hard to run. 2. it will be easier to support sighup for gc parameters.
Owner

I somewhat agree, but here we add a function which looks unnecessary batchSize := c.gcCfg.getExpiredObjectBatchSize doesn't make the code simpler to me.

Also, how would SIGHUP become easier?

I somewhat agree, but here we add a function which looks unnecessary `batchSize := c.gcCfg.getExpiredObjectBatchSize` doesn't make the code simpler to me. Also, how would SIGHUP become easier?
Owner

I guess I see, we could lock in the function and lock during SIGHUP.

I guess I see, we could lock in the function and lock during SIGHUP.
acid-ant approved these changes 2023-03-21 08:11:46 +00:00
dstepanov-yadro force-pushed bug/OBJECT-2279 from 0112da3974 to 7a31988a36 2023-03-21 08:31:31 +00:00 Compare
fyrchik approved these changes 2023-03-21 08:56:23 +00:00
fyrchik merged commit 7a31988a36 into master 2023-03-21 08:56:55 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
4 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#145
No description provided.