Skip to content

Commit 4be5c93

Browse files
authored
Merge 030b8b8 into cc226a3
2 parents cc226a3 + 030b8b8 commit 4be5c93

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

ydb/core/base/hive.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,15 @@ namespace NKikimr {
705705
Record.SetStatus(status);
706706
Record.SetStatusMessage(statusMessage);
707707
}
708+
709+
TString ToString() const override {
710+
TStringStream str;
711+
str << ToStringHeader() << "{Status: " << NKikimrProto::EReplyStatus_Name(Record.GetStatus()).data();
712+
str << " TabletID: " << Record.GetTabletID();
713+
str << " Message: " << Record.GetStatusMessage();
714+
str << "}";
715+
return str.Str();
716+
}
708717
};
709718

710719
struct TEvLockTabletExecutionLost : public TEventPB<TEvLockTabletExecutionLost,

ydb/core/mind/hive/hive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ inline void Out<NKikimr::NHive::TCompleteNotifications>(IOutputStream& o, const
383383
if (it != n.Notifications.begin()) {
384384
o << ',';
385385
}
386-
o << Hex(it->first->Type) << " " << it->first.Get()->Recipient;
386+
o << Hex(it->first->Type) << " " << it->first.Get()->Recipient << " " << it->first->ToString();
387387
}
388388
}
389389
}

ydb/core/mind/hive/tx__lock_tablet.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
1616

1717
TSideEffects SideEffects;
1818
TActorId PreviousOwner;
19+
bool Success = true;
1920

2021
public:
2122
TTxLockTabletExecution(const NKikimrHive::TEvLockTabletExecution& rec, const TActorId& sender, const ui64 cookie, THive* hive)
@@ -43,6 +44,7 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
4344
NKikimrProto::ERROR,
4445
TStringBuilder() << "Trying to lock tablet " << TabletId << " to an invalid owner actor"
4546
), 0, Cookie);
47+
Success = false;
4648
return true;
4749
}
4850

@@ -53,6 +55,7 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
5355
NKikimrProto::ERROR,
5456
TStringBuilder() << "Trying to lock tablet " << TabletId << ", which doesn't exist"
5557
), 0, Cookie);
58+
Success = false;
5659
return true;
5760
}
5861

@@ -62,6 +65,7 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
6265
NKikimrProto::ERROR,
6366
TStringBuilder() << "Trying to lock tablet " << TabletId << " to " << OwnerActor << ", which is on a different node"
6467
), 0, Cookie);
68+
Success = false;
6569
return true;
6670
}
6771

@@ -71,6 +75,7 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
7175
NKikimrProto::ERROR,
7276
TStringBuilder() << "Trying to restore lock to tablet " << TabletId << ", which has expired"
7377
), 0, Cookie);
78+
Success = false;
7479
return true;
7580
}
7681

@@ -106,7 +111,11 @@ class TTxLockTabletExecution : public TTransactionBase<THive> {
106111
}
107112

108113
void Complete(const TActorContext& ctx) override {
109-
BLOG_D("THive::TTxLockTabletExecution::Complete TabletId: " << TabletId << " SideEffects: " << SideEffects);
114+
if (Success) {
115+
BLOG_D("THive::TTxLockTabletExecution::Complete TabletId: " << TabletId << " SideEffects: " << SideEffects);
116+
} else {
117+
BLOG_NOTICE("THive::TTxLockTabletExecution::Complete TabletId: " << TabletId << " SideEffects: " << SideEffects);
118+
}
110119
SideEffects.Complete(ctx);
111120
}
112121

ydb/core/mind/hive/tx__unlock_tablet.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TTxUnlockTabletExecution : public TTransactionBase<THive> {
3737
{}
3838

3939
bool Execute(TTransactionContext& txc, const TActorContext&) override {
40-
BLOG_D("THive::TTxUnlockTabletExecution::Execute TabletId: " << TabletId);
40+
BLOG_NOTICE("THive::TTxUnlockTabletExecution::Execute TabletId: " << TabletId);
4141
SideEffects.Reset(Self->SelfId());
4242
TLeaderTabletInfo* tablet = Self->FindTabletEvenInDeleting(TabletId);
4343
if (tablet == nullptr) {
@@ -82,7 +82,7 @@ class TTxUnlockTabletExecution : public TTransactionBase<THive> {
8282
}
8383

8484
void Complete(const TActorContext& ctx) override {
85-
BLOG_D("THive::TTxUnlockTabletExecution::Complete TabletId: " << TabletId << " SideEffects: " << SideEffects);
85+
BLOG_NOTICE("THive::TTxUnlockTabletExecution::Complete TabletId: " << TabletId << " SideEffects: " << SideEffects);
8686
SideEffects.Complete(ctx);
8787
}
8888

@@ -106,6 +106,7 @@ ITransaction* THive::CreateUnlockTabletExecution(ui64 tabletId, ui64 seqNo) {
106106

107107
void THive::ScheduleUnlockTabletExecution(TNodeInfo& node) {
108108
// Unlock tablets that have been locked by this node
109+
BLOG_NOTICE("ScheduleUnlockTabletExecution(" << node.Id << ", " << NKikimrHive::ELockLostReason_Name(reason) << ")");
109110
for (TLeaderTabletInfo* tablet : node.LockedTablets) {
110111
Y_ABORT_UNLESS(FindTabletEvenInDeleting(tablet->Id) == tablet);
111112
Y_ABORT_UNLESS(tablet->LockedToActor.NodeId() == node.Id);
@@ -125,7 +126,7 @@ void THive::ScheduleUnlockTabletExecution(TNodeInfo& node) {
125126
void THive::Handle(TEvPrivate::TEvUnlockTabletReconnectTimeout::TPtr& ev) {
126127
TTabletId tabletId = ev->Get()->TabletId;
127128
ui64 seqNo = ev->Get()->SeqNo;
128-
BLOG_D("THive::Handle::TEvUnlockTabletReconnectTimeout TabletId=" << tabletId);
129+
BLOG_NOTICE("THive::Handle::TEvUnlockTabletReconnectTimeout TabletId=" << tabletId << " Reason=" << NKikimrHive::ELockLostReason_Name(ev->Get()->Reason));
129130
TLeaderTabletInfo* tablet = FindTabletEvenInDeleting(tabletId);
130131
if (tablet != nullptr && tablet->IsLockedToActor() && tablet->PendingUnlockSeqNo == seqNo) {
131132
// We use sequence numbers to make sure unlock happens only if some

0 commit comments

Comments
 (0)