aboutsummaryrefslogtreecommitdiffstats
path: root/yt
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-01-25 17:37:12 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-01-25 17:54:30 +0300
commit8a97d83ae06bdc3c3a00702807298318954e22b0 (patch)
tree4fb138e51abfb8cf12a2f9ce88d593f93ee658c7 /yt
parent92502a76d0643424ba08a7952b337a658afa301d (diff)
downloadydb-8a97d83ae06bdc3c3a00702807298318954e22b0.tar.gz
Intermediate changes
Diffstat (limited to 'yt')
-rw-r--r--yt/yt/client/api/security_client.h4
-rw-r--r--yt/yt/client/driver/authentication_commands.cpp6
-rw-r--r--yt/yt/core/concurrency/retrying_periodic_executor.cpp15
-rw-r--r--yt/yt/core/concurrency/retrying_periodic_executor.h5
-rw-r--r--yt/yt/library/column_converters/column_converter.cpp2
5 files changed, 24 insertions, 8 deletions
diff --git a/yt/yt/client/api/security_client.h b/yt/yt/client/api/security_client.h
index 87ceab45f3..39e752799c 100644
--- a/yt/yt/client/api/security_client.h
+++ b/yt/yt/client/api/security_client.h
@@ -70,7 +70,9 @@ struct TCheckPermissionByAclResult
struct TSetUserPasswordOptions
: public TTimeoutOptions
-{ };
+{
+ bool PasswordIsTemporary = false;
+};
struct TIssueTokenOptions
: public TTimeoutOptions
diff --git a/yt/yt/client/driver/authentication_commands.cpp b/yt/yt/client/driver/authentication_commands.cpp
index 60546f842c..eeadbbbbc2 100644
--- a/yt/yt/client/driver/authentication_commands.cpp
+++ b/yt/yt/client/driver/authentication_commands.cpp
@@ -16,6 +16,12 @@ void TSetUserPasswordCommand::Register(TRegistrar registrar)
registrar.Parameter("current_password_sha256", &TThis::CurrentPasswordSha256_)
.Default();
registrar.Parameter("new_password_sha256", &TThis::NewPasswordSha256_);
+ registrar.ParameterWithUniversalAccessor<bool>(
+ "password_is_temporary",
+ [] (TThis* command) -> bool& {
+ return command->Options.PasswordIsTemporary;
+ })
+ .Default(false);
}
void TSetUserPasswordCommand::DoExecute(ICommandContextPtr context)
diff --git a/yt/yt/core/concurrency/retrying_periodic_executor.cpp b/yt/yt/core/concurrency/retrying_periodic_executor.cpp
index f8df164712..6858366ddd 100644
--- a/yt/yt/core/concurrency/retrying_periodic_executor.cpp
+++ b/yt/yt/core/concurrency/retrying_periodic_executor.cpp
@@ -69,6 +69,9 @@ void TRetryingInvocationTimePolicy::SetOptions(
CachedBackoffMultiplier_.store(
backoffOptions->BackoffMultiplier,
std::memory_order::relaxed);
+ CachedBackoffJitter_.store(
+ backoffOptions->BackoffJitter,
+ std::memory_order::relaxed);
Backoff_.UpdateOptions(*backoffOptions);
}
@@ -93,11 +96,15 @@ void TRetryingInvocationTimePolicy::Reset()
Backoff_.Restart();
}
-TDuration TRetryingInvocationTimePolicy::GetBackoffTimeEstimate() const
+std::tuple<TDuration, TDuration> TRetryingInvocationTimePolicy::GetBackoffInterval() const
{
- return
+ auto backoffMedian =
CachedBackoffDuration_.load(std::memory_order::relaxed) *
CachedBackoffMultiplier_.load(std::memory_order::relaxed);
+
+ auto backoffJitter = CachedBackoffJitter_.load(std::memory_order::relaxed);
+
+ return std::tuple(backoffMedian * (1 - backoffJitter), backoffMedian * (1 + backoffJitter));
}
bool TRetryingInvocationTimePolicy::IsInBackoffMode() const
@@ -149,9 +156,9 @@ TRetryingPeriodicExecutor::TRetryingPeriodicExecutor(
backoffOptions)
{ }
-TDuration TRetryingPeriodicExecutor::GetBackoffTimeEstimate() const
+std::tuple<TDuration, TDuration> TRetryingPeriodicExecutor::GetBackoffInterval() const
{
- return TBase::GetBackoffTimeEstimate();
+ return TBase::GetBackoffInterval();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/concurrency/retrying_periodic_executor.h b/yt/yt/core/concurrency/retrying_periodic_executor.h
index 5bf0182905..6cb6d36a3e 100644
--- a/yt/yt/core/concurrency/retrying_periodic_executor.h
+++ b/yt/yt/core/concurrency/retrying_periodic_executor.h
@@ -47,12 +47,13 @@ public:
void Reset();
- TDuration GetBackoffTimeEstimate() const;
+ std::tuple<TDuration, TDuration> GetBackoffInterval() const;
private:
//! Used for backoff time estimation
std::atomic<TDuration> CachedBackoffDuration_;
std::atomic<double> CachedBackoffMultiplier_;
+ std::atomic<double> CachedBackoffJitter_;
TBackoffStrategy Backoff_;
@@ -86,7 +87,7 @@ public:
TExponentialBackoffOptions backoffOptions,
std::optional<TDuration> period = {});
- TDuration GetBackoffTimeEstimate() const;
+ std::tuple<TDuration, TDuration> GetBackoffInterval() const;
private:
using TBase = NDetail::TPeriodicExecutorBase<NDetail::TRetryingInvocationTimePolicy>;
diff --git a/yt/yt/library/column_converters/column_converter.cpp b/yt/yt/library/column_converters/column_converter.cpp
index 40d7a13733..b177657daa 100644
--- a/yt/yt/library/column_converters/column_converter.cpp
+++ b/yt/yt/library/column_converters/column_converter.cpp
@@ -107,7 +107,7 @@ TConvertedColumnRange TColumnConverters::ConvertRowsToColumns(
YT_VERIFY(iterSchema != columnSchema.end());
auto converter = CreateColumnConvert(iterSchema->second, ColumnIds_[offset], offset);
auto columns = converter->Convert(rowsValues);
- convertedColumnsRange.emplace_back(std::move(columns));
+ convertedColumnsRange.push_back(std::move(columns));
}
return convertedColumnsRange;
}