Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cloud/filestore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -680,4 +680,10 @@ message TStorageConfig
// Allow SysViewProcessor and StatisticsAggregator tablets for compatibility
// with newer versions of ydb (24-2 and older)
optional bool AllowAdditionalSystemTablets = 470;

// Enable adding unconfirmed blobs for write operations
optional bool AddingUnconfirmedBlobsEnabled = 471;

// Limits unconfirmed (and confirmed but not added to the index) blob count.
optional uint32 UnconfirmedBlobCountHardLimit = 472;
}
2 changes: 2 additions & 0 deletions cloud/filestore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ using TAliases = NProto::TStorageConfig::TFilestoreAliases;
xxx(DirectoryHandlesTableSize, ui64, 100'000 )\
xxx(GuestHandleKillPrivV2Enabled, bool, false )\
xxx(AllowAdditionalSystemTablets, bool, false )\
xxx(AddingUnconfirmedBlobsEnabled, bool, false )\
xxx(UnconfirmedBlobCountHardLimit, ui32, 0 )\
// FILESTORE_STORAGE_CONFIG

#define FILESTORE_STORAGE_CONFIG_REF(xxx) \
Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ class TStorageConfig
bool GetGuestHandleKillPrivV2Enabled() const;

[[nodiscard]] bool GetAllowAdditionalSystemTablets() const;

bool GetAddingUnconfirmedBlobsEnabled() const;
ui32 GetUnconfirmedBlobCountHardLimit() const;
};

} // namespace NCloud::NFileStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ TWriteDataActor::TWriteDataActor(
TRequestInfoPtr requestInfo,
ui64 commitId,
TVector<TMergedBlob> blobs,
TWriteRange writeRange)
TWriteRange writeRange,
bool shouldAddUnconfirmedBlobs)
: TraceSerializer(std::move(traceSerializer))
, LogTag(std::move(logTag))
, Tablet(tablet)
, RequestInfo(std::move(requestInfo))
, CommitId(commitId)
, Blobs(std::move(blobs))
, WriteRange(writeRange)
, ShouldAddUnconfirmedBlobs(shouldAddUnconfirmedBlobs)
{
for (const auto& blob: Blobs) {
BlobsSize += blob.BlobContent.size();
Expand Down Expand Up @@ -123,7 +125,8 @@ void TWriteDataActor::ReplyAndDie(
CommitId,
1,
BlobsSize,
ctx.Now() - RequestInfo->StartedTs);
ctx.Now() - RequestInfo->StartedTs,
ShouldAddUnconfirmedBlobs);
NCloud::Send(ctx, Tablet, std::move(response));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
const ui64 CommitId;
/*const*/ TVector<TMergedBlob> Blobs;
const TWriteRange WriteRange;
const bool ShouldAddUnconfirmedBlobs;
ui32 BlobsSize = 0;

public:
Expand All @@ -37,7 +38,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
TRequestInfoPtr requestInfo,
ui64 commitId,
TVector<TMergedBlob> blobs,
TWriteRange writeRange);
TWriteRange writeRange,
bool shouldAddUnconfirmedBlobs);

void Bootstrap(const TActorContext& ctx);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,17 @@ void TIndexTabletActor::CompleteTx_WriteData(

AcquireCollectBarrier(args.CommitId);

bool ShouldAddUnconfirmedBlobs = Config->GetAddingUnconfirmedBlobsEnabled();

auto actor = std::make_unique<TWriteDataActor>(
TraceSerializer,
LogTag,
ctx.SelfID,
args.RequestInfo,
args.CommitId,
std::move(blobs),
TWriteRange{args.NodeId, args.ByteRange.End()});
TWriteRange{args.NodeId, args.ByteRange.End()},
ShouldAddUnconfirmedBlobs);

auto actorId = NCloud::Register(ctx, std::move(actor));
WorkerActors.insert(actorId);
Expand Down
27 changes: 24 additions & 3 deletions cloud/filestore/libs/storage/tablet/tablet_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,28 @@ struct TEvIndexTabletPrivate
// ReadWrite completion
//

using TReadWriteCompleted = TOperationCompleted;
using TReadDataCompleted = TOperationCompleted;

struct TWriteDataCompleted: TOperationCompleted
{
const bool AddingUnconfirmedBlobsRequested;

TWriteDataCompleted(
TSet<ui32> mixedBlocksRanges,
ui64 commitId,
ui32 requestCount,
ui32 requestBytes,
TDuration d,
bool addingUnconfirmedBlobsRequested)
: TOperationCompleted(
std::move(mixedBlocksRanges),
commitId,
requestCount,
requestBytes,
d)
, AddingUnconfirmedBlobsRequested(addingUnconfirmedBlobsRequested)
{}
};

//
// AddData completion
Expand Down Expand Up @@ -961,9 +982,9 @@ struct TEvIndexTabletPrivate
TRequestEvent<TReleaseCollectBarrier, EvReleaseCollectBarrier>;

using TEvReadDataCompleted =
TResponseEvent<TReadWriteCompleted, EvReadDataCompleted>;
TResponseEvent<TReadDataCompleted, EvReadDataCompleted>;
using TEvWriteDataCompleted =
TResponseEvent<TReadWriteCompleted, EvWriteDataCompleted>;
TResponseEvent<TWriteDataCompleted, EvWriteDataCompleted>;
using TEvAddDataCompleted =
TResponseEvent<TAddDataCompleted, EvAddDataCompleted>;

Expand Down
Loading