Skip to content

Commit

Permalink
Merge 312d080 into 309e2b0
Browse files Browse the repository at this point in the history
  • Loading branch information
mregrock authored Dec 9, 2024
2 parents 309e2b0 + 312d080 commit c5ca30a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
67 changes: 67 additions & 0 deletions ydb/core/base/blobstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ struct TEvBlobStorage {
// user <-> proxy interface
EvPut = EventSpaceBegin(TKikimrEvents::ES_BLOBSTORAGE), /// 268 632 064
EvGet,
EvGetBlock,
EvBlock,
EvDiscover,
EvRange,
Expand All @@ -497,6 +498,7 @@ struct TEvBlobStorage {
//
EvPutResult = EvPut + 512, /// 268 632 576
EvGetResult,
EvGetBlockResult,
EvBlockResult,
EvDiscoverResult,
EvRangeResult,
Expand Down Expand Up @@ -915,6 +917,7 @@ struct TEvBlobStorage {

struct TEvPutResult;
struct TEvGetResult;
struct TEvGetBlockResult;
struct TEvBlockResult;
struct TEvDiscoverResult;
struct TEvRangeResult;
Expand Down Expand Up @@ -1330,6 +1333,70 @@ struct TEvBlobStorage {
}
};

struct TEvGetBlock : public TEventLocal<TEvGetBlock, EvGetBlock> {
const TInstant Deadline;
const ui64 TabletId;
ui32 RestartCounter = 0;
std::shared_ptr<TExecutionRelay> ExecutionRelay;

TEvGetBlock(TInstant deadline, ui64 tabletId)
: Deadline(deadline)
, TabletId(tabletId)
{}

TString Print(bool isFull) const {
Y_UNUSED(isFull);
TStringStream str;
str << "TEvGetBlock {TabletId# " << TabletId
<< " Deadline# " << Deadline.MilliSeconds()
<< "}";
return str.Str();
}

TString ToString() const {
return Print(false);
}

ui32 CalculateSize() const {
return sizeof(*this);
}

void ToSpan(NWilson::TSpan& span) const;

std::unique_ptr<TEvGetBlockResult> MakeErrorResponse(NKikimrProto::EReplyStatus status, const TString& errorReason,
TGroupId groupId);
};

struct TEvGetBlockResult : public TEventLocal<TEvGetBlockResult, EvGetBlockResult> {
NKikimrProto::EReplyStatus Status;
ui64 TabletId;
ui32 BlockedGeneration;
TString ErrorReason;
std::shared_ptr<TExecutionRelay> ExecutionRelay;

TEvGetBlockResult(NKikimrProto::EReplyStatus status, ui64 tabletId, ui32 blockedGeneration)
: Status(status)
, TabletId(tabletId)
, BlockedGeneration(blockedGeneration)
{}

TString Print(bool isFull) const {
Y_UNUSED(isFull);
TStringStream str;
str << "TEvGetBlockResult {Status# " << NKikimrProto::EReplyStatus_Name(Status).data();
str << " TabletId# " << TabletId << " BlockedGeneration# " << BlockedGeneration;
if (ErrorReason.size()) {
str << " ErrorReason# \"" << ErrorReason << "\"";
}
str << "}";
return str.Str();
}

TString ToString() const {
return Print(false);
}
};

struct TEvBlock : public TEventLocal<TEvBlock, EvBlock> {
const ui64 TabletId;
const ui32 Generation;
Expand Down
10 changes: 10 additions & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,16 @@ struct TBlobStorageGroupBlockParameters {
};
IActor* CreateBlobStorageGroupBlockRequest(TBlobStorageGroupBlockParameters params);

struct TBlobStorageGroupGetBlockParameters {
TBlobStorageGroupRequestActor::TCommonParameters<TEvBlobStorage::TEvVGetBlock> Common;
TBlobStorageGroupRequestActor::TTypeSpecificParameters TypeSpecific = {
.LogComponent = NKikimrServices::BS_PROXY_GETBLOCK,
.Name = "DSProxy.GetBlock",
.Activity = NKikimrServices::TActivity::BS_GROUP_GETBLOCK,
};
};
IActor* CreateBlobStorageGroupGetBlockRequest(TBlobStorageGroupGetBlockParameters params);

struct TBlobStorageGroupStatusParameters {
TBlobStorageGroupRequestActor::TCommonParameters<TEvBlobStorage::TEvStatus> Common;
TBlobStorageGroupRequestActor::TTypeSpecificParameters TypeSpecific = {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_mon.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class TBlobStorageGroupProxyMon : public TThrRefBase {
::NMonitoring::TDynamicCounters::TCounterPtr ActivePut;
::NMonitoring::TDynamicCounters::TCounterPtr ActivePutCapacity;
::NMonitoring::TDynamicCounters::TCounterPtr ActiveGet;
::NMonitoring::TDynamicCounters::TCounterPtr ActiveGetBlock;
::NMonitoring::TDynamicCounters::TCounterPtr ActiveGetCapacity;
::NMonitoring::TDynamicCounters::TCounterPtr ActiveBlock;
::NMonitoring::TDynamicCounters::TCounterPtr ActiveDiscover;
Expand Down
1 change: 1 addition & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct TDsProxyNodeMon : public TThrRefBase {
// restart counters
::NMonitoring::TDynamicCounters::TCounterPtr RestartPut;
::NMonitoring::TDynamicCounters::TCounterPtr RestartGet;
::NMonitoring::TDynamicCounters::TCounterPtr RestartGetBlock;
::NMonitoring::TDynamicCounters::TCounterPtr RestartBlock;
::NMonitoring::TDynamicCounters::TCounterPtr RestartDiscover;
::NMonitoring::TDynamicCounters::TCounterPtr RestartRange;
Expand Down
2 changes: 2 additions & 0 deletions ydb/library/services/services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ enum EServiceKikimr {
BS_VDISK_DEFRAG = 346;
BS_PROXY_ASSIMILATE = 347;
BS_VDISK_BALANCING = 2600;
BS_PROXY_GETBLOCK = 2601;

// DATASHARD section //
TX_DATASHARD = 290; //
Expand Down Expand Up @@ -1068,5 +1069,6 @@ message TActivity {
RESHUFFLE_KMEANS_SCAN_ACTOR = 650;
FEATURE_FLAGS_CONFIGURATOR = 651;
DATASHARD_READ_SCAN = 652;
BS_GROUP_GETBLOCK = 653;
};
};

0 comments on commit c5ca30a

Please sign in to comment.