@@ -27,6 +27,7 @@ namespace NKikimr::NPQ {
27
27
28
28
static const ui32 BATCH_UNPACK_SIZE_BORDER = 500_KB;
29
29
static const ui32 MAX_INLINE_SIZE = 1000 ;
30
+ static const TDuration SubDomainQuotaWaitDurationMs = TDuration::Seconds(60 );
30
31
31
32
static constexpr NPersQueue::NErrorCode::EErrorCode InactivePartitionErrorCode = NPersQueue::NErrorCode::WRITE_ERROR_PARTITION_INACTIVE;
32
33
@@ -1488,6 +1489,16 @@ void TPartition::SetDeadlinesForWrites(const TActorContext& ctx) {
1488
1489
1489
1490
ctx.Schedule (QuotaDeadline, new TEvPQ::TEvQuotaDeadlineCheck ());
1490
1491
}
1492
+
1493
+ auto quotaWaitDurationMs = TDuration::MilliSeconds (AppData (ctx)->PQConfig .GetQuotingConfig ().GetQuotaWaitDurationMs ());
1494
+ if (SubDomainOutOfSpace) {
1495
+ quotaWaitDurationMs = quotaWaitDurationMs ? std::min (quotaWaitDurationMs, SubDomainQuotaWaitDurationMs) : SubDomainQuotaWaitDurationMs;
1496
+ }
1497
+ if (quotaWaitDurationMs > TDuration::Zero () && QuotaDeadline == TInstant::Zero ()) {
1498
+ QuotaDeadline = ctx.Now () + quotaWaitDurationMs;
1499
+
1500
+ ctx.Schedule (QuotaDeadline, new TEvPQ::TEvQuotaDeadlineCheck ());
1501
+ }
1491
1502
}
1492
1503
1493
1504
void TPartition::Handle (TEvPQ::TEvQuotaDeadlineCheck::TPtr&, const TActorContext& ctx) {
@@ -1513,7 +1524,7 @@ void TPartition::FilterDeadlinedWrites(const TActorContext& ctx, TMessageQueue&
1513
1524
{
1514
1525
TMessageQueue newRequests;
1515
1526
for (auto & w : requests) {
1516
- if (!w.IsWrite () || w.GetWrite ().Msg .IgnoreQuotaDeadline ) {
1527
+ if (!w.IsWrite () || ( w.GetWrite ().Msg .IgnoreQuotaDeadline && !SubDomainOutOfSpace) ) {
1517
1528
newRequests.emplace_back (std::move (w));
1518
1529
continue ;
1519
1530
}
@@ -1529,7 +1540,8 @@ void TPartition::FilterDeadlinedWrites(const TActorContext& ctx, TMessageQueue&
1529
1540
WriteInflightSize -= msg.Data .size ();
1530
1541
}
1531
1542
1532
- ReplyError (ctx, w.GetCookie (), NPersQueue::NErrorCode::OVERLOAD, " quota exceeded" );
1543
+ TString errorMsg = SubDomainOutOfSpace ? " database size exceeded" : " quota exceeded" ;
1544
+ ReplyError (ctx, w.GetCookie (), NPersQueue::NErrorCode::OVERLOAD, errorMsg);
1533
1545
}
1534
1546
requests = std::move (newRequests);
1535
1547
}
0 commit comments