Cancel writecache background flush as soon as possible #1205

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/writecache_close_while_flushing into master 2024-06-28 06:26:28 +00:00

Scenario:

  1. Writecache is full and flushes big objects
  2. frostfs-node tries to close writecache

Writecache will try to get modeMtx lock to cancel background flush, but lock is taken by big object flush worker.

Closes #1201

Scenario: 1. Writecache is full and flushes `big` objects 2. `frostfs-node` tries to close writecache Writecache will try to get `modeMtx` lock to cancel background flush, but lock is taken by big object flush worker. Closes #1201
dstepanov-yadro requested review from storage-core-committers 2024-06-26 09:24:48 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-06-26 09:24:49 +00:00
acid-ant approved these changes 2024-06-26 09:53:00 +00:00
aarifullin approved these changes 2024-06-26 10:52:46 +00:00
achuprov approved these changes 2024-06-26 10:57:37 +00:00
fyrchik requested changes 2024-06-26 11:04:23 +00:00
@ -151,3 +151,3 @@
func (c *cache) workerFlushBig(ctx context.Context) {
tick := time.NewTicker(defaultFlushInterval * 10)
tick := time.NewTicker(defaultFlushInterval)
Owner

Please, describe the motivation behind this change in the commit message.
It can affect perfomance, as we do not currently remove empty directories automatically.

Please, describe the motivation behind this change in the commit message. It can affect perfomance, as we do not currently remove empty directories automatically.
Author
Member

Done.
It looks like it's some kind of debug code. This code appeared in the very first cache implementation without any explanation.

Done. It looks like it's some kind of debug code. This code appeared in the very first cache implementation without any explanation.
Owner

It was actually intentional, because we should have less big objects and more small ones.
Iterating over the DB is much cheaper that touching filesystem.
I would introduce a separate constant for big iteration, as the magic constant is indeed the problem.

It was actually intentional, because we should have less big objects and more small ones. Iterating over the DB is much cheaper that touching filesystem. I would introduce a separate constant for big iteration, as the magic constant is indeed the problem.
Author
Member

Ok, dropped commit with this change.

Ok, dropped commit with this change.
dstepanov-yadro force-pushed fix/writecache_close_while_flushing from 86be1fa186 to 62f7a2e4cc 2024-06-26 11:11:29 +00:00 Compare
dstepanov-yadro force-pushed fix/writecache_close_while_flushing from 62f7a2e4cc to cde7b266fc 2024-06-27 14:05:11 +00:00 Compare
dstepanov-yadro force-pushed fix/writecache_close_while_flushing from cde7b266fc to 4c7ff159ec 2024-06-28 06:03:09 +00:00 Compare
fyrchik approved these changes 2024-06-28 06:26:03 +00:00
fyrchik merged commit 4c7ff159ec into master 2024-06-28 06:26:27 +00:00
Sign in to join this conversation.
No milestone
No project
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#1205
No description provided.