Skip to content

Commit eab0cbf

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

File tree

13 files changed

+277
-838
lines changed

13 files changed

+277
-838
lines changed

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

Lines changed: 5 additions & 6 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

@@ -51,16 +51,15 @@ struct TNodeState
5151
// Tracks cached data parts
5252
TNodeCache Cache;
5353

54-
// Prevent from concurrent read and write requests with overlapping ranges
55-
TReadWriteRangeLock RangeLock;
56-
57-
ENodeFlushStatus FlushStatus = ENodeFlushStatus::NothingToFlush;
54+
// Prevents flushed requests from being evicted from Cache
55+
TMultiSet<ui64> CachedDataPins;
5856

5957
// Flush requests are fulfilled when there are no pending or unflushed
6058
// requests with SequenceId less or equal than |TFlushRequest::SequenceId|.
6159
// Flush requests are stored in chronological order: SequenceId values are
6260
// strictly increasing so newer flush requests have larger SequenceId.
6361
TDeque<TFlushRequest> FlushRequests;
62+
ENodeFlushStatus FlushStatus = ENodeFlushStatus::NothingToFlush;
6463

6564
// Cached data extends the node size but until the data is flushed,
6665
// the changes are not visible to the tablet. FileSystem requests that
@@ -70,7 +69,7 @@ struct TNodeState
7069

7170
bool CanBeDeleted() const
7271
{
73-
if (Cache.Empty() && RangeLock.Empty()) {
72+
if (Cache.Empty() && CachedDataPins.empty()) {
7473
Y_ABORT_UNLESS(FlushRequests.empty());
7574
Y_ABORT_UNLESS(FlushStatus == ENodeFlushStatus::NothingToFlush);
7675
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)