aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmel1k <shmel1k@ydb.tech>2022-09-11 12:14:04 +0300
committershmel1k <shmel1k@ydb.tech>2022-09-11 12:14:04 +0300
commit0648583939a54be7d704ae9ff043ae0f42b97e4c (patch)
treee20a32d0df4b170aec736eef862929b91941cfcc
parent67576a8962c2506b8ee10da48dffba311acb0042 (diff)
downloadydb-0648583939a54be7d704ae9ff043ae0f42b97e4c.tar.gz
[] improve error message on invalid retentions
-rw-r--r--ydb/services/lib/actors/pq_schema_actor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/ydb/services/lib/actors/pq_schema_actor.cpp b/ydb/services/lib/actors/pq_schema_actor.cpp
index 4bf336d16a9..5934f0aa0b3 100644
--- a/ydb/services/lib/actors/pq_schema_actor.cpp
+++ b/ydb/services/lib/actors/pq_schema_actor.cpp
@@ -416,16 +416,16 @@ namespace NKikimr::NGRpcProxy::V1 {
}
TStringBuilder errStr;
- errStr << "retention seconds and storage bytes must fit one of:";
+ errStr << "retention hours and storage megabytes must fit one of:";
bool found = false;
for (auto& limit : retentionLimits) {
- errStr << " { seconds : [" << limit.GetMinPeriodSeconds() << ", " << limit.GetMaxPeriodSeconds() << "], "
- << " storage : [" << limit.GetMinStorageMegabytes() * 1_MB << ", " << limit.GetMaxStorageMegabytes() * 1_MB << "]},";
+ errStr << " { hours : [" << limit.GetMinPeriodSeconds() / 3600 << ", " << limit.GetMaxPeriodSeconds() / 3600 << "], "
+ << " storage : [" << limit.GetMinStorageMegabytes() << ", " << limit.GetMaxStorageMegabytes() << "]},";
found = found || (lifeTimeSeconds >= limit.GetMinPeriodSeconds() && lifeTimeSeconds <= limit.GetMaxPeriodSeconds() &&
- storageBytes >= limit.GetMinStorageMegabytes() * 1_MB && storageBytes <= limit.GetMaxStorageMegabytes() * 1_MB);
+ storageBytes >= limit.GetMinStorageMegabytes() * 1_MB && storageBytes <= limit.GetMaxStorageMegabytes() * 1_MB);
}
if (!found) {
- error = errStr << " provided values: seconds " << lifeTimeSeconds << ", storage " << storageBytes;
+ error = errStr << " provided values: hours " << lifeTimeSeconds / 3600 << ", storage " << storageBytes / 1_MB;
return Ydb::StatusIds::BAD_REQUEST;
}