Skip to content

Commit 9647acd

Browse files
author
Andrei Nasonov
committed
issue-1751: [Filestore] WriteBackCache: Replace ReadWriteRangeLock with pinning mechanism, move remaining code to TUtils
1 parent aff2df7 commit 9647acd

14 files changed

+281
-849
lines changed

cloud/filestore/libs/vfs_fuse/write_back_cache/node_state.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#pragma once
22

33
#include "node_cache.h"
4-
#include "read_write_range_lock.h"
54

65
#include <cloud/filestore/public/api/protos/data.pb.h>
76

87
#include <library/cpp/threading/future/core/future.h>
98

109
#include <util/generic/deque.h>
10+
#include <util/generic/set.h>
1111

1212
namespace NCloud::NFileStore::NFuse::NWriteBackCache {
1313

@@ -48,8 +48,8 @@ struct TNodeState
4848
// Tracks cached data parts
4949
TNodeCache Cache;
5050

51-
// Prevent from concurrent read and write requests with overlapping ranges
52-
TReadWriteRangeLock RangeLock;
51+
// Prevents flushed requests from being evicted from Cache
52+
TMultiSet<ui64> CachedDataPins;
5353

5454
ENodeFlushStatus FlushStatus = ENodeFlushStatus::NothingToFlush;
5555

@@ -67,7 +67,7 @@ struct TNodeState
6767

6868
bool CanBeDeleted() const
6969
{
70-
if (Cache.Empty() && RangeLock.Empty()) {
70+
if (Cache.Empty() && CachedDataPins.empty()) {
7171
Y_ABORT_UNLESS(FlushRequests.empty());
7272
Y_ABORT_UNLESS(FlushStatus == ENodeFlushStatus::NothingToFlush);
7373
return true;

cloud/filestore/libs/vfs_fuse/write_back_cache/read_write_range_lock.cpp

Lines changed: 0 additions & 101 deletions
This file was deleted.

cloud/filestore/libs/vfs_fuse/write_back_cache/read_write_range_lock.h

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)