diff options
author | asorotsky <asorotsky@yandex-team.ru> | 2022-02-10 16:47:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:33 +0300 |
commit | eb540cc7a103419462d0cc870ca403966e2194c6 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c | |
parent | 80f0a6b4102e3b2c89f23935c7690409033ea24c (diff) | |
download | ydb-eb540cc7a103419462d0cc870ca403966e2194c6.tar.gz |
Restoring authorship annotation for <asorotsky@yandex-team.ru>. Commit 2 of 2.
67 files changed, 851 insertions, 851 deletions
diff --git a/contrib/libs/libaio/io_cancel.c b/contrib/libs/libaio/io_cancel.c index 7dd33d0df9..298751a6ec 100644 --- a/contrib/libs/libaio/io_cancel.c +++ b/contrib/libs/libaio/io_cancel.c @@ -19,4 +19,4 @@ #include "libaio.h" #include "syscall.h" -io_syscall3(int, io_cancel, io_cancel, io_context_t, ctx, struct iocb *, iocb, struct io_event *, event) +io_syscall3(int, io_cancel, io_cancel, io_context_t, ctx, struct iocb *, iocb, struct io_event *, event) diff --git a/contrib/libs/libaio/io_getevents.c b/contrib/libs/libaio/io_getevents.c index 510765c020..b606e43283 100644 --- a/contrib/libs/libaio/io_getevents.c +++ b/contrib/libs/libaio/io_getevents.c @@ -39,8 +39,8 @@ struct aio_ring { unsigned header_length; /* size of aio_ring */ }; - -int io_getevents(io_context_t ctx, long min_nr, long nr, struct io_event * events, struct timespec * timeout) + +int io_getevents(io_context_t ctx, long min_nr, long nr, struct io_event * events, struct timespec * timeout) { struct aio_ring *ring; ring = (struct aio_ring*)ctx; diff --git a/contrib/libs/libaio/io_queue_wait.c b/contrib/libs/libaio/io_queue_wait.c index b8d81789ed..e706901953 100644 --- a/contrib/libs/libaio/io_queue_wait.c +++ b/contrib/libs/libaio/io_queue_wait.c @@ -24,7 +24,7 @@ struct timespec; -int io_queue_wait(io_context_t ctx, struct timespec *timeout) +int io_queue_wait(io_context_t ctx, struct timespec *timeout) { return io_getevents(ctx, 0, 0, NULL, timeout); } diff --git a/library/cpp/actors/core/event_local.h b/library/cpp/actors/core/event_local.h index a197a7c9d7..2845aa94dd 100644 --- a/library/cpp/actors/core/event_local.h +++ b/library/cpp/actors/core/event_local.h @@ -9,7 +9,7 @@ namespace NActors { template <typename TEv, ui32 TEventType> class TEventLocal: public TEventBase<TEv, TEventType> { public: - TString ToStringHeader() const override { + TString ToStringHeader() const override { return TypeName<TEv>(); } @@ -17,7 +17,7 @@ namespace NActors { Y_FAIL("Serialization of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType); } - bool IsSerializable() const override { + bool IsSerializable() const override { return false; } diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index 32e93fef8a..d7546b901a 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -88,19 +88,19 @@ namespace NActors { return Event; } - bool Next(void** data, int* size) override; - void BackUp(int count) override; + bool Next(void** data, int* size) override; + void BackUp(int count) override; int64_t ByteCount() const override { return TotalSerializedDataSize; } - bool WriteAliasedRaw(const void* data, int size) override; - bool AllowsAliasing() const override; + bool WriteAliasedRaw(const void* data, int size) override; + bool AllowsAliasing() const override; bool WriteRope(const TRope *rope) override; bool WriteString(const TString *s) override; protected: - void DoRun() override; + void DoRun() override; void Resume(); bool Produce(const void *data, size_t size); diff --git a/library/cpp/actors/core/executor_pool_basic.h b/library/cpp/actors/core/executor_pool_basic.h index 9c089bcee6..023190f7fe 100644 --- a/library/cpp/actors/core/executor_pool_basic.h +++ b/library/cpp/actors/core/executor_pool_basic.h @@ -58,7 +58,7 @@ namespace NActors { const ui32 EventsPerMailbox; const int RealtimePriority; - + TAtomic ThreadUtilization; TAtomic MaxUtilizationCounter; TAtomic MaxUtilizationAccumulator; diff --git a/library/cpp/actors/core/executor_pool_io.h b/library/cpp/actors/core/executor_pool_io.h index 03ed4288d3..e576d642a1 100644 --- a/library/cpp/actors/core/executor_pool_io.h +++ b/library/cpp/actors/core/executor_pool_io.h @@ -23,13 +23,13 @@ namespace NActors { TTicketLock ScheduleLock; const TString PoolName; - + public: TIOExecutorPool(ui32 poolId, ui32 threads, const TString& poolName = "", TAffinity* affinity = nullptr, ui32 maxActivityType = 1); explicit TIOExecutorPool(const TIOExecutorPoolConfig& cfg); ~TIOExecutorPool(); - + ui32 GetReadyActivation(TWorkerContext& wctx, ui64 revolvingCounter) override; void Schedule(TInstant deadline, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie, TWorkerId workerId) override; diff --git a/library/cpp/actors/core/executor_pool_united.h b/library/cpp/actors/core/executor_pool_united.h index fa8e4f0391..a090ba2466 100644 --- a/library/cpp/actors/core/executor_pool_united.h +++ b/library/cpp/actors/core/executor_pool_united.h @@ -60,7 +60,7 @@ namespace NActors { // Returns per worker schedule writers NSchedulerQueue::TWriter* GetScheduleWriter(TWorkerId workerId) const; - + // Sets executor for specified pool void SetupPool(TPoolId pool, IExecutorPool* executorPool, TMailboxTable* mailboxTable); diff --git a/library/cpp/actors/core/executor_thread.h b/library/cpp/actors/core/executor_thread.h index 1dc8b315e0..9d3c573f0d 100644 --- a/library/cpp/actors/core/executor_thread.h +++ b/library/cpp/actors/core/executor_thread.h @@ -83,7 +83,7 @@ namespace NActors { TVector<THolder<IActor>> DyingActors; TActorId CurrentRecipient; ui64 CurrentActorScheduledEventsCounter = 0; - + // Thread-specific TWorkerContext Ctx; ui64 RevolvingReadCounter = 0; diff --git a/library/cpp/actors/core/log_settings.cpp b/library/cpp/actors/core/log_settings.cpp index 75fa1a1dd6..f52f2fc5d2 100644 --- a/library/cpp/actors/core/log_settings.cpp +++ b/library/cpp/actors/core/log_settings.cpp @@ -49,34 +49,34 @@ namespace NActors { } void TSettings::Append(EComponent minVal, EComponent maxVal, EComponentToStringFunc func) { - Y_VERIFY(minVal >= 0, "NLog::TSettings: minVal must be non-negative"); + Y_VERIFY(minVal >= 0, "NLog::TSettings: minVal must be non-negative"); Y_VERIFY(maxVal > minVal, "NLog::TSettings: maxVal must be greater than minVal"); // update bounds - if (!MaxVal || minVal < MinVal) { - MinVal = minVal; - } + if (!MaxVal || minVal < MinVal) { + MinVal = minVal; + } if (!MaxVal || maxVal > MaxVal) { - MaxVal = maxVal; - + MaxVal = maxVal; + // expand ComponentNames to the new bounds - auto oldMask = Mask; - Mask = PowerOf2Mask(MaxVal); - - TArrayHolder<TAtomic> oldComponentInfo(new TAtomic[Mask + 1]); - ComponentInfo.Swap(oldComponentInfo); - int startVal = oldMask ? oldMask + 1 : 0; - for (int i = 0; i < startVal; i++) { - AtomicSet(ComponentInfo[i], AtomicGet(oldComponentInfo[i])); - } - - TComponentSettings defSetting(DefPriority, DefSamplingPriority, DefSamplingRate); - for (int i = startVal; i < Mask + 1; i++) { - AtomicSet(ComponentInfo[i], defSetting.Raw.Data); - } - - ComponentNames.resize(Mask + 1); + auto oldMask = Mask; + Mask = PowerOf2Mask(MaxVal); + + TArrayHolder<TAtomic> oldComponentInfo(new TAtomic[Mask + 1]); + ComponentInfo.Swap(oldComponentInfo); + int startVal = oldMask ? oldMask + 1 : 0; + for (int i = 0; i < startVal; i++) { + AtomicSet(ComponentInfo[i], AtomicGet(oldComponentInfo[i])); + } + + TComponentSettings defSetting(DefPriority, DefSamplingPriority, DefSamplingRate); + for (int i = startVal; i < Mask + 1; i++) { + AtomicSet(ComponentInfo[i], defSetting.Raw.Data); + } + + ComponentNames.resize(Mask + 1); } // assign new names but validate if newly added members were not used before diff --git a/library/cpp/actors/core/scheduler_basic.cpp b/library/cpp/actors/core/scheduler_basic.cpp index 3cb40546ae..fba200e16b 100644 --- a/library/cpp/actors/core/scheduler_basic.cpp +++ b/library/cpp/actors/core/scheduler_basic.cpp @@ -7,7 +7,7 @@ #ifdef BALLOC #include <library/cpp/balloc/optional/operators.h> #endif - + namespace NActors { struct TBasicSchedulerThread::TMonCounters { @@ -57,7 +57,7 @@ namespace NActors { ui64 currentMonotonic = RelaxedLoad(CurrentMonotonic); ui64 throttledMonotonic = currentMonotonic; - + ui64 activeTick = AlignUp<ui64>(throttledMonotonic, IntrasecondThreshold); TAutoPtr<TMomentMap> activeSec; diff --git a/library/cpp/actors/helpers/future_callback.h b/library/cpp/actors/helpers/future_callback.h index ae8fe045c3..8ca0d99fda 100644 --- a/library/cpp/actors/helpers/future_callback.h +++ b/library/cpp/actors/helpers/future_callback.h @@ -1,7 +1,7 @@ #pragma once #include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NActors { diff --git a/library/cpp/actors/memory_log/memlog.h b/library/cpp/actors/memory_log/memlog.h index a16d694ba2..2aa27272a6 100644 --- a/library/cpp/actors/memory_log/memlog.h +++ b/library/cpp/actors/memory_log/memlog.h @@ -45,7 +45,7 @@ public: return AtomicGet(MemLogBuffer); } - void* GetWriteBuffer(size_t amount) noexcept; + void* GetWriteBuffer(size_t amount) noexcept; inline static void* GetWriteBufferStatic(size_t amount) noexcept { auto logger = GetMemoryLogger(); @@ -62,7 +62,7 @@ public: inline static void CreateMemoryLogBuffer( size_t totalSize = DEFAULT_TOTAL_SIZE, size_t grainSize = DEFAULT_GRAIN_SIZE) - Y_COLD { + Y_COLD { if (AtomicGet(MemLogBuffer) != nullptr) { return; } @@ -73,7 +73,7 @@ public: static std::atomic<bool> PrintLastMark; // buffer must be at least 16 bytes - static void ChangeLastMark(char* buffer) noexcept; + static void ChangeLastMark(char* buffer) noexcept; inline static TThread::TId GetTheadId() noexcept { if (LogThreadId == 0) { @@ -83,7 +83,7 @@ public: } private: - TMemoryLog(size_t totalSize, size_t grainSize) Y_COLD; + TMemoryLog(size_t totalSize, size_t grainSize) Y_COLD; struct TGrain { TAtomic WritePointer = 0; @@ -170,12 +170,12 @@ private: // it's no use of sanitizing this function NO_SANITIZE_THREAD -char* BareMemLogWrite( +char* BareMemLogWrite( const char* begin, size_t msgSize, bool isLast = true) noexcept; // it's no use of sanitizing this function NO_SANITIZE_THREAD -bool MemLogWrite( +bool MemLogWrite( const char* begin, size_t msgSize, bool addLF = false) noexcept; Y_WRAPPER inline bool MemLogWrite(const char* begin, const char* end) noexcept { diff --git a/library/cpp/actors/util/thread.h b/library/cpp/actors/util/thread.h index c3b0c62356..d742c8c585 100644 --- a/library/cpp/actors/util/thread.h +++ b/library/cpp/actors/util/thread.h @@ -1,26 +1,26 @@ -#pragma once - -#include <util/generic/strbuf.h> -#include <util/stream/str.h> -#include <util/system/execpath.h> -#include <util/system/thread.h> -#include <util/system/thread.h> +#pragma once + +#include <util/generic/strbuf.h> +#include <util/stream/str.h> +#include <util/system/execpath.h> +#include <util/system/thread.h> +#include <util/system/thread.h> #include <time.h> - + inline void SetCurrentThreadName(const TString& name, const ui32 maxCharsFromProcessName = 8) { -#if defined(_linux_) +#if defined(_linux_) // linux limits threadname by 15 + \0 TStringBuf procName(GetExecPath()); procName = procName.RNextTok('/'); procName = procName.SubStr(0, maxCharsFromProcessName); - TStringStream linuxName; + TStringStream linuxName; linuxName << procName << "." << name; TThread::SetCurrentThreadName(linuxName.Str().data()); -#else +#else Y_UNUSED(maxCharsFromProcessName); TThread::SetCurrentThreadName(name.data()); -#endif -} +#endif +} diff --git a/library/cpp/lfalloc/alloc_profiler/align_ut.cpp b/library/cpp/lfalloc/alloc_profiler/align_ut.cpp index 1b62fe73b7..db9b17b95b 100644 --- a/library/cpp/lfalloc/alloc_profiler/align_ut.cpp +++ b/library/cpp/lfalloc/alloc_profiler/align_ut.cpp @@ -1,23 +1,23 @@ -#include <library/cpp/testing/unittest/registar.h> - -#include <util/generic/scope.h> - -Y_UNIT_TEST_SUITE(MemAlign) { - Y_UNIT_TEST(ShouldAlign) - { - for (ui64 size = 8; size <= 32 * 1024; size *= 8) { - for (ui64 align = 8; align <= 4096; align *=2) { - void* ptr = nullptr; - - int res = posix_memalign(&ptr, align, size); - UNIT_ASSERT_C(res == 0 && ptr != nullptr, "memalign failed"); - - Y_DEFER { - free(ptr); - }; - - UNIT_ASSERT_C((uintptr_t)ptr % align == 0, "non aligned memory"); - } - } - } -} +#include <library/cpp/testing/unittest/registar.h> + +#include <util/generic/scope.h> + +Y_UNIT_TEST_SUITE(MemAlign) { + Y_UNIT_TEST(ShouldAlign) + { + for (ui64 size = 8; size <= 32 * 1024; size *= 8) { + for (ui64 align = 8; align <= 4096; align *=2) { + void* ptr = nullptr; + + int res = posix_memalign(&ptr, align, size); + UNIT_ASSERT_C(res == 0 && ptr != nullptr, "memalign failed"); + + Y_DEFER { + free(ptr); + }; + + UNIT_ASSERT_C((uintptr_t)ptr % align == 0, "non aligned memory"); + } + } + } +} diff --git a/library/cpp/lfalloc/alloc_profiler/profiler.cpp b/library/cpp/lfalloc/alloc_profiler/profiler.cpp index b4f92fe0db..0e30927a5a 100644 --- a/library/cpp/lfalloc/alloc_profiler/profiler.cpp +++ b/library/cpp/lfalloc/alloc_profiler/profiler.cpp @@ -1,5 +1,5 @@ #include "profiler.h" - + #include "stackcollect.h" #include <util/generic/algorithm.h> diff --git a/library/cpp/lfalloc/alloc_profiler/stackcollect.cpp b/library/cpp/lfalloc/alloc_profiler/stackcollect.cpp index 643fd1ccda..fded4e2fd1 100644 --- a/library/cpp/lfalloc/alloc_profiler/stackcollect.cpp +++ b/library/cpp/lfalloc/alloc_profiler/stackcollect.cpp @@ -1,5 +1,5 @@ #include "stackcollect.h" - + #include "profiler.h" #include <util/generic/algorithm.h> diff --git a/library/cpp/lfalloc/alloc_profiler/ut/ya.make b/library/cpp/lfalloc/alloc_profiler/ut/ya.make index 9b93752823..8a7daa74af 100644 --- a/library/cpp/lfalloc/alloc_profiler/ut/ya.make +++ b/library/cpp/lfalloc/alloc_profiler/ut/ya.make @@ -16,7 +16,7 @@ ENDIF() SRCS( profiler_ut.cpp - align_ut.cpp + align_ut.cpp ) END() diff --git a/library/cpp/lfalloc/lf_allocX64.h b/library/cpp/lfalloc/lf_allocX64.h index 70f3758ebf..fd2a906d6f 100644 --- a/library/cpp/lfalloc/lf_allocX64.h +++ b/library/cpp/lfalloc/lf_allocX64.h @@ -1089,7 +1089,7 @@ struct TLocalPerTagAllocCounter { }; static const int DBG_ALLOC_MAX_TAG = 1000; -static const int DBG_ALLOC_ALIGNED_TAG = 0xF0000000; +static const int DBG_ALLOC_ALIGNED_TAG = 0xF0000000; static const int DBG_ALLOC_NUM_SIZES = 30; static TPerTagAllocCounter GlobalPerTagAllocCounters[DBG_ALLOC_MAX_TAG][DBG_ALLOC_NUM_SIZES]; @@ -1307,25 +1307,25 @@ static void AllocThreadInfo() { #if defined(LFALLOC_DBG) struct TAllocHeader { - uint64_t Size; + uint64_t Size; int Tag; int Cookie; }; -// should be power of 2 -static_assert(sizeof(TAllocHeader) == 16); - +// should be power of 2 +static_assert(sizeof(TAllocHeader) == 16); + static inline void* GetAllocPtr(TAllocHeader* p) { return p + 1; } static inline TAllocHeader* GetAllocHeader(void* p) { - auto* header = ((TAllocHeader*)p) - 1; - if (header->Tag == DBG_ALLOC_ALIGNED_TAG) { - return (TAllocHeader*)header->Size; - } - - return header; + auto* header = ((TAllocHeader*)p) - 1; + if (header->Tag == DBG_ALLOC_ALIGNED_TAG) { + return (TAllocHeader*)header->Size; + } + + return header; } PERTHREAD int AllocationTag; @@ -1882,45 +1882,45 @@ static Y_FORCE_INLINE int LFPosixMemalign(void** memptr, size_t alignment, size_ } else if (bigsize < 2 * alignment) { bigsize = 2 * alignment; } -#if defined(LFALLOC_DBG) - if (alignment > sizeof(TAllocHeader)) { - bigsize += alignment; - } -#endif - +#if defined(LFALLOC_DBG) + if (alignment > sizeof(TAllocHeader)) { + bigsize += alignment; + } +#endif + *memptr = LFAlloc(bigsize); - -#if defined(LFALLOC_DBG) - if (alignment > sizeof(TAllocHeader)) { - // memptr isn't aligned due to alloc header - const auto* header = GetAllocHeader(*memptr); - *memptr = (void*)((const char*) (*memptr) + alignment - sizeof(TAllocHeader)); - - // make fake header to retrieve original header ptr on dealloc - auto* next = GetAllocHeader(*memptr); - next->Tag = DBG_ALLOC_ALIGNED_TAG; - next->Size = (uint64_t)header; - next->Cookie = 0; - } -#endif - - Y_ASSERT_NOBT((intptr_t)*memptr % alignment == 0); + +#if defined(LFALLOC_DBG) + if (alignment > sizeof(TAllocHeader)) { + // memptr isn't aligned due to alloc header + const auto* header = GetAllocHeader(*memptr); + *memptr = (void*)((const char*) (*memptr) + alignment - sizeof(TAllocHeader)); + + // make fake header to retrieve original header ptr on dealloc + auto* next = GetAllocHeader(*memptr); + next->Tag = DBG_ALLOC_ALIGNED_TAG; + next->Size = (uint64_t)header; + next->Cookie = 0; + } +#endif + + Y_ASSERT_NOBT((intptr_t)*memptr % alignment == 0); return 0; } - -static Y_FORCE_INLINE void* LFVAlloc(size_t size) { - const size_t pg = N_PAGE_SIZE; - void* p = nullptr; - -#if defined(LFALLOC_DBG) - LFPosixMemalign(&p, pg, size); -#else - size_t bigsize = (size + pg - 1) & (~(pg - 1)); - p = LFAlloc(bigsize); -#endif - - Y_ASSERT_NOBT((intptr_t)p % N_PAGE_SIZE == 0); - return p; -} - -#endif + +static Y_FORCE_INLINE void* LFVAlloc(size_t size) { + const size_t pg = N_PAGE_SIZE; + void* p = nullptr; + +#if defined(LFALLOC_DBG) + LFPosixMemalign(&p, pg, size); +#else + size_t bigsize = (size + pg - 1) & (~(pg - 1)); + p = LFAlloc(bigsize); +#endif + + Y_ASSERT_NOBT((intptr_t)p % N_PAGE_SIZE == 0); + return p; +} + +#endif diff --git a/library/cpp/lwtrace/all.h b/library/cpp/lwtrace/all.h index b02925c44b..d7aa57c49d 100644 --- a/library/cpp/lwtrace/all.h +++ b/library/cpp/lwtrace/all.h @@ -2,7 +2,7 @@ #include "control.h" #include "event.h" -#include "preprocessor.h" +#include "preprocessor.h" #include "probe.h" #include "start.h" diff --git a/library/cpp/lwtrace/check.cpp b/library/cpp/lwtrace/check.cpp index 2fa7c7bc22..4e34fc5d49 100644 --- a/library/cpp/lwtrace/check.cpp +++ b/library/cpp/lwtrace/check.cpp @@ -1,6 +1,6 @@ #include "check.h" - -#include <util/stream/output.h> + +#include <util/stream/output.h> #include <util/string/cast.h> namespace NLWTrace { diff --git a/library/cpp/lwtrace/control.h b/library/cpp/lwtrace/control.h index 8f4393b64e..16b24eafd2 100644 --- a/library/cpp/lwtrace/control.h +++ b/library/cpp/lwtrace/control.h @@ -1,15 +1,15 @@ #pragma once -#include "custom_action.h" -#include "event.h" -#include "log.h" +#include "custom_action.h" +#include "event.h" +#include "log.h" #include "log_shuttle.h" -#include "probe.h" - +#include "probe.h" + #include <library/cpp/lwtrace/protos/lwtrace.pb.h> - + #include <google/protobuf/repeated_field.h> - + #include <util/generic/deque.h> #include <util/generic/hash.h> #include <util/generic/noncopyable.h> diff --git a/library/cpp/lwtrace/custom_action.cpp b/library/cpp/lwtrace/custom_action.cpp index bfe07b4fbd..a379b34ec0 100644 --- a/library/cpp/lwtrace/custom_action.cpp +++ b/library/cpp/lwtrace/custom_action.cpp @@ -1,5 +1,5 @@ #include "custom_action.h" - + #include "control.h" using namespace NLWTrace; diff --git a/library/cpp/lwtrace/custom_action.h b/library/cpp/lwtrace/custom_action.h index 3744d4c586..92a3c66b84 100644 --- a/library/cpp/lwtrace/custom_action.h +++ b/library/cpp/lwtrace/custom_action.h @@ -1,13 +1,13 @@ #pragma once #include "probe.h" - + #include <library/cpp/lwtrace/protos/lwtrace.pb.h> -#include <util/generic/hash.h> - -#include <functional> - +#include <util/generic/hash.h> + +#include <functional> + namespace NLWTrace { class TSession; diff --git a/library/cpp/lwtrace/event.h b/library/cpp/lwtrace/event.h index 0d81f92475..e53a620c45 100644 --- a/library/cpp/lwtrace/event.h +++ b/library/cpp/lwtrace/event.h @@ -1,9 +1,9 @@ #pragma once -#include "preprocessor.h" +#include "preprocessor.h" #include "signature.h" #include "param_traits.h" - + #include <library/cpp/lwtrace/protos/lwtrace.pb.h> namespace NLWTrace { diff --git a/library/cpp/lwtrace/kill_action.cpp b/library/cpp/lwtrace/kill_action.cpp index ace41b7aec..2b74dc4587 100644 --- a/library/cpp/lwtrace/kill_action.cpp +++ b/library/cpp/lwtrace/kill_action.cpp @@ -1,11 +1,11 @@ -#include "kill_action.h" +#include "kill_action.h" #ifndef _win_ #include <sys/types.h> #include <signal.h> #endif -#include <stdlib.h> +#include <stdlib.h> using namespace NLWTrace; using namespace NLWTrace::NPrivate; diff --git a/library/cpp/lwtrace/log.h b/library/cpp/lwtrace/log.h index dad2197b0b..56981a97f8 100644 --- a/library/cpp/lwtrace/log.h +++ b/library/cpp/lwtrace/log.h @@ -1,19 +1,19 @@ #pragma once -#include "probe.h" - -#include <util/datetime/base.h> -#include <util/generic/algorithm.h> -#include <util/generic/deque.h> +#include "probe.h" + +#include <util/datetime/base.h> +#include <util/generic/algorithm.h> +#include <util/generic/deque.h> #include <util/generic/noncopyable.h> #include <util/generic/vector.h> -#include <util/string/printf.h> -#include <util/system/atomic.h> -#include <util/system/hp_timer.h> +#include <util/string/printf.h> +#include <util/system/atomic.h> +#include <util/system/hp_timer.h> #include <util/system/mutex.h> #include <util/system/spinlock.h> #include <util/system/thread.h> -#include <util/system/tls.h> +#include <util/system/tls.h> namespace NLWTrace { // Cyclic buffer that pushes items to its back and pop item from front on overflow diff --git a/library/cpp/lwtrace/lwprobe.h b/library/cpp/lwtrace/lwprobe.h index 0bd8253ea9..801fc3861b 100644 --- a/library/cpp/lwtrace/lwprobe.h +++ b/library/cpp/lwtrace/lwprobe.h @@ -1,8 +1,8 @@ #pragma once -#include "control.h" -#include "probe.h" - +#include "control.h" +#include "probe.h" + #include <ctype.h> namespace NLWTrace { diff --git a/library/cpp/lwtrace/perf.cpp b/library/cpp/lwtrace/perf.cpp index 190aca306f..03b68586ea 100644 --- a/library/cpp/lwtrace/perf.cpp +++ b/library/cpp/lwtrace/perf.cpp @@ -1,7 +1,7 @@ #include "perf.h" -#include "probes.h" - +#include "probes.h" + #include <util/system/datetime.h> #include <util/system/hp_timer.h> diff --git a/library/cpp/lwtrace/preprocessor.h b/library/cpp/lwtrace/preprocessor.h index 396c7ff7f6..40865467b2 100644 --- a/library/cpp/lwtrace/preprocessor.h +++ b/library/cpp/lwtrace/preprocessor.h @@ -4,11 +4,11 @@ #include "perf.h" #include "symbol.h" -#include <util/generic/hide_ptr.h> -#include <util/system/platform.h> - -#include <stddef.h> //size_t - +#include <util/generic/hide_ptr.h> +#include <util/system/platform.h> + +#include <stddef.h> //size_t + #ifdef _win_ #ifndef LWTRACE_DISABLE #define LWTRACE_DISABLE diff --git a/library/cpp/lwtrace/probe.h b/library/cpp/lwtrace/probe.h index 31cf4974c9..31fa282da3 100644 --- a/library/cpp/lwtrace/probe.h +++ b/library/cpp/lwtrace/probe.h @@ -5,11 +5,11 @@ #include "rwspinlock.h" #include "shuttle.h" -#include <util/datetime/cputimer.h> -#include <util/generic/hide_ptr.h> +#include <util/datetime/cputimer.h> +#include <util/generic/hide_ptr.h> #include <util/generic/scope.h> -#include <util/system/atomic.h> - +#include <util/system/atomic.h> + namespace NLWTrace { // Represents a chain (linked list) of steps for execution of a trace query block // NOTE: different executor objects are used on different probes (even for the same query block) diff --git a/library/cpp/lwtrace/probes.h b/library/cpp/lwtrace/probes.h index 6513e941ab..68810bd118 100644 --- a/library/cpp/lwtrace/probes.h +++ b/library/cpp/lwtrace/probes.h @@ -1,6 +1,6 @@ #pragma once -#include "all.h" +#include "all.h" #define LWTRACE_INTERNAL_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(PerfReport, GROUPS(), \ diff --git a/library/cpp/lwtrace/shuttle.h b/library/cpp/lwtrace/shuttle.h index 49f55efef2..85c6e4da61 100644 --- a/library/cpp/lwtrace/shuttle.h +++ b/library/cpp/lwtrace/shuttle.h @@ -1,15 +1,15 @@ #pragma once -#include "event.h" - +#include "event.h" + #include <library/cpp/containers/stack_vector/stack_vec.h> - + #include <util/generic/ptr.h> #include <util/system/spinlock.h> -#include <algorithm> +#include <algorithm> #include <type_traits> - + namespace NLWTrace { struct TProbe; diff --git a/library/cpp/lwtrace/signature.h b/library/cpp/lwtrace/signature.h index 8ed5b8be4b..868bd9bcf2 100644 --- a/library/cpp/lwtrace/signature.h +++ b/library/cpp/lwtrace/signature.h @@ -1,9 +1,9 @@ #pragma once -#include "preprocessor.h" - +#include "preprocessor.h" + #include <library/cpp/lwtrace/protos/lwtrace.pb.h> - + #include <util/generic/cast.h> #include <util/generic/string.h> #include <util/generic/typetraits.h> diff --git a/library/cpp/lwtrace/sleep_action.cpp b/library/cpp/lwtrace/sleep_action.cpp index ebcafa7d74..74977528db 100644 --- a/library/cpp/lwtrace/sleep_action.cpp +++ b/library/cpp/lwtrace/sleep_action.cpp @@ -1,11 +1,11 @@ -#include "sleep_action.h" +#include "sleep_action.h" #include "control.h" - + #include <util/system/datetime.h> -#include <stdlib.h> - +#include <stdlib.h> + using namespace NLWTrace; using namespace NLWTrace::NPrivate; diff --git a/library/cpp/lwtrace/start.cpp b/library/cpp/lwtrace/start.cpp index ec971ce184..121d5472b6 100644 --- a/library/cpp/lwtrace/start.cpp +++ b/library/cpp/lwtrace/start.cpp @@ -1,15 +1,15 @@ -#include "start.h" +#include "start.h" + +#include "all.h" -#include "all.h" - #include <google/protobuf/text_format.h> #include <util/generic/singleton.h> #include <util/stream/file.h> -#include <util/stream/output.h> +#include <util/stream/output.h> #include <util/system/env.h> -#include <stdlib.h> +#include <stdlib.h> using namespace NLWTrace; diff --git a/library/cpp/lwtrace/stderr_writer.cpp b/library/cpp/lwtrace/stderr_writer.cpp index 629b14135b..6e5654c338 100644 --- a/library/cpp/lwtrace/stderr_writer.cpp +++ b/library/cpp/lwtrace/stderr_writer.cpp @@ -1,5 +1,5 @@ #include "stderr_writer.h" - + #include <util/stream/str.h> using namespace NLWTrace; diff --git a/library/cpp/lwtrace/symbol.cpp b/library/cpp/lwtrace/symbol.cpp index 745437cb25..456652bcd0 100644 --- a/library/cpp/lwtrace/symbol.cpp +++ b/library/cpp/lwtrace/symbol.cpp @@ -1,6 +1,6 @@ #include "symbol.h" - -#include <util/stream/output.h> + +#include <util/stream/output.h> #include <util/string/cast.h> template <> diff --git a/library/cpp/lwtrace/trace.cpp b/library/cpp/lwtrace/trace.cpp index 2e756e2670..3c974c85a0 100644 --- a/library/cpp/lwtrace/trace.cpp +++ b/library/cpp/lwtrace/trace.cpp @@ -1,16 +1,16 @@ -#include "all.h" +#include "all.h" #include "kill_action.h" -#include "log_shuttle.h" -#include "preprocessor.h" +#include "log_shuttle.h" +#include "preprocessor.h" #include "sleep_action.h" -#include "stderr_writer.h" +#include "stderr_writer.h" #include "google/protobuf/repeated_field.h" - + #include <util/generic/map.h> #include <util/random/random.h> -#include <functional> - +#include <functional> + namespace NLWTrace { #ifndef LWTRACE_DISABLE diff --git a/library/cpp/threading/chunk_queue/queue.h b/library/cpp/threading/chunk_queue/queue.h index 311222e4dc..55859601a1 100644 --- a/library/cpp/threading/chunk_queue/queue.h +++ b/library/cpp/threading/chunk_queue/queue.h @@ -34,14 +34,14 @@ namespace NThreading { static_assert(sizeof(*this) % PadSize == 0, "padding does not work"); Y_UNUSED(Pad); } - - template<typename... Args> - TPadded(Args&&... args) - : T(std::forward<Args>(args)...) - { - static_assert(sizeof(*this) % PadSize == 0, "padding does not work"); - Y_UNUSED(Pad); - } + + template<typename... Args> + TPadded(Args&&... args) + : T(std::forward<Args>(args)...) + { + static_assert(sizeof(*this) % PadSize == 0, "padding does not work"); + Y_UNUSED(Pad); + } }; //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index 3973b9c170..5fd4296a93 100644 --- a/library/cpp/threading/future/core/future-inl.h +++ b/library/cpp/threading/future/core/future-inl.h @@ -16,10 +16,10 @@ namespace NThreading { //////////////////////////////////////////////////////////////////////////////// - enum class TError { - Error - }; - + enum class TError { + Error + }; + template <typename T> class TFutureState: public TAtomicRefCount<TFutureState<T>> { enum { @@ -89,13 +89,13 @@ namespace NThreading { { } - TFutureState(std::exception_ptr exception, TError) - : State(ExceptionSet) - , Exception(std::move(exception)) - , NullValue(0) - { - } - + TFutureState(std::exception_ptr exception, TError) + : State(ExceptionSet) + , Exception(std::move(exception)) + , NullValue(0) + { + } + ~TFutureState() { if (State >= ValueMoved) { // ValueMoved, ValueSet, ValueRead Value.~T(); @@ -277,12 +277,12 @@ namespace NThreading { { } - TFutureState(std::exception_ptr exception, TError) - : State(ExceptionSet) - , Exception(std::move(exception)) - { - } - + TFutureState(std::exception_ptr exception, TError) + : State(ExceptionSet) + , Exception(std::move(exception)) + { + } + bool HasValue() const { return AtomicGet(State) == ValueSet; } @@ -971,12 +971,12 @@ namespace NThreading { return Singleton<TCache>()->Instance; } - template <typename T> - inline TFuture<T> MakeErrorFuture(std::exception_ptr exception) - { - return {new NImpl::TFutureState<T>(std::move(exception), NImpl::TError::Error)}; - } - + template <typename T> + inline TFuture<T> MakeErrorFuture(std::exception_ptr exception) + { + return {new NImpl::TFutureState<T>(std::move(exception), NImpl::TError::Error)}; + } + inline TFuture<void> MakeFuture() { struct TCache { TFuture<void> Instance{new NImpl::TFutureState<void>(true)}; diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index b8442f94c6..2e82bb953e 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -28,8 +28,8 @@ namespace NThreading { TFuture<std::remove_reference_t<T>> MakeFuture(T&& value); template <typename T> TFuture<T> MakeFuture(); - template <typename T> - TFuture<T> MakeErrorFuture(std::exception_ptr exception); + template <typename T> + TFuture<T> MakeErrorFuture(std::exception_ptr exception); TFuture<void> MakeFuture(); //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/threading/future/future_ut.cpp b/library/cpp/threading/future/future_ut.cpp index f44272bef0..05950a568d 100644 --- a/library/cpp/threading/future/future_ut.cpp +++ b/library/cpp/threading/future/future_ut.cpp @@ -281,17 +281,17 @@ namespace { TVector<TFuture<void>> promises; promises.push_back(promise1); promises.push_back(promise2); - + TFuture<void> future = WaitExceptionOrAll(promises); UNIT_ASSERT(!future.HasValue()); - + promise1.SetValue(); UNIT_ASSERT(!future.HasValue()); - + promise2.SetValue(); UNIT_ASSERT(future.HasValue()); } - + Y_UNIT_TEST(ShouldWaitExceptionOrAllVectorWithValueType) { TPromise<int> promise1 = NewPromise<int>(); TPromise<int> promise2 = NewPromise<int>(); @@ -313,7 +313,7 @@ namespace { Y_UNIT_TEST(ShouldWaitExceptionOrAllList) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); - + std::list<TFuture<void>> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -334,25 +334,25 @@ namespace { TFuture<void> future = WaitExceptionOrAll(promises); UNIT_ASSERT(future.HasValue()); } - + Y_UNIT_TEST(ShouldWaitAnyVector) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); - + TVector<TFuture<void>> promises; promises.push_back(promise1); promises.push_back(promise2); - + TFuture<void> future = WaitAny(promises); UNIT_ASSERT(!future.HasValue()); - + promise1.SetValue(); UNIT_ASSERT(future.HasValue()); - + promise2.SetValue(); UNIT_ASSERT(future.HasValue()); } - + Y_UNIT_TEST(ShouldWaitAnyVectorWithValueType) { TPromise<int> promise1 = NewPromise<int>(); @@ -375,7 +375,7 @@ namespace { Y_UNIT_TEST(ShouldWaitAnyList) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); - + std::list<TFuture<void>> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -396,11 +396,11 @@ namespace { TFuture<void> future = WaitAny(promises); UNIT_ASSERT(future.HasValue()); } - + Y_UNIT_TEST(ShouldWaitAny) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); - + TFuture<void> future = WaitAny(promise1, promise2); UNIT_ASSERT(!future.HasValue()); @@ -506,7 +506,7 @@ namespace { UNIT_ASSERT(promise.TrySetValue(42)); UNIT_ASSERT(!promise.TrySetValue(42)); } - + Y_UNIT_TEST(HandlingRepetitiveSetException) { TPromise<int> promise = NewPromise<int>(); promise.SetException("test"); @@ -519,24 +519,24 @@ namespace { UNIT_ASSERT(!promise.TrySetException(std::make_exception_ptr("test"))); } - Y_UNIT_TEST(ShouldAllowToMakeFutureWithException) - { - auto future1 = MakeErrorFuture<void>(std::make_exception_ptr(TFutureException())); - UNIT_ASSERT(future1.HasException()); - UNIT_CHECK_GENERATED_EXCEPTION(future1.GetValue(), TFutureException); - - auto future2 = MakeErrorFuture<int>(std::make_exception_ptr(TFutureException())); - UNIT_ASSERT(future2.HasException()); - UNIT_CHECK_GENERATED_EXCEPTION(future2.GetValue(), TFutureException); - - auto future3 = MakeFuture<std::exception_ptr>(std::make_exception_ptr(TFutureException())); - UNIT_ASSERT(future3.HasValue()); - UNIT_CHECK_GENERATED_NO_EXCEPTION(future3.GetValue(), TFutureException); - - auto future4 = MakeFuture<std::unique_ptr<int>>(nullptr); - UNIT_ASSERT(future4.HasValue()); - UNIT_CHECK_GENERATED_NO_EXCEPTION(future4.GetValue(), TFutureException); - } + Y_UNIT_TEST(ShouldAllowToMakeFutureWithException) + { + auto future1 = MakeErrorFuture<void>(std::make_exception_ptr(TFutureException())); + UNIT_ASSERT(future1.HasException()); + UNIT_CHECK_GENERATED_EXCEPTION(future1.GetValue(), TFutureException); + + auto future2 = MakeErrorFuture<int>(std::make_exception_ptr(TFutureException())); + UNIT_ASSERT(future2.HasException()); + UNIT_CHECK_GENERATED_EXCEPTION(future2.GetValue(), TFutureException); + + auto future3 = MakeFuture<std::exception_ptr>(std::make_exception_ptr(TFutureException())); + UNIT_ASSERT(future3.HasValue()); + UNIT_CHECK_GENERATED_NO_EXCEPTION(future3.GetValue(), TFutureException); + + auto future4 = MakeFuture<std::unique_ptr<int>>(nullptr); + UNIT_ASSERT(future4.HasValue()); + UNIT_CHECK_GENERATED_NO_EXCEPTION(future4.GetValue(), TFutureException); + } Y_UNIT_TEST(WaitAllowsExtract) { auto future = MakeFuture<int>(42); diff --git a/library/cpp/threading/future/wait/wait-inl.h b/library/cpp/threading/future/wait/wait-inl.h index 1803ab3dcc..2753d5446c 100644 --- a/library/cpp/threading/future/wait/wait-inl.h +++ b/library/cpp/threading/future/wait/wait-inl.h @@ -28,7 +28,7 @@ namespace NThreading { [[nodiscard]] NImpl::EnableGenericWait<TContainer> WaitExceptionOrAll(const TContainer& futures) { return WaitExceptionOrAll(NImpl::ToVoidFutures(futures)); } - + template <typename TContainer> [[nodiscard]] NImpl::EnableGenericWait<TContainer> WaitAny(const TContainer& futures) { return WaitAny(NImpl::ToVoidFutures(futures)); diff --git a/library/cpp/threading/future/wait/wait.cpp b/library/cpp/threading/future/wait/wait.cpp index c84d9864af..a173833a7f 100644 --- a/library/cpp/threading/future/wait/wait.cpp +++ b/library/cpp/threading/future/wait/wait.cpp @@ -65,7 +65,7 @@ namespace NThreading { TFuture<void> WaitExceptionOrAll(TArrayRef<const TFuture<void>> futures) { return WaitGeneric<TWaitPolicy::TExceptionOrAll>(futures); } - + //////////////////////////////////////////////////////////////////////////////// TFuture<void> WaitAny(const TFuture<void>& f1) { diff --git a/library/cpp/threading/future/wait/wait.h b/library/cpp/threading/future/wait/wait.h index 493fe34298..6ff7d57baa 100644 --- a/library/cpp/threading/future/wait/wait.h +++ b/library/cpp/threading/future/wait/wait.h @@ -29,8 +29,8 @@ namespace NThreading { [[nodiscard]] NImpl::EnableGenericWait<TContainer> WaitExceptionOrAll(const TContainer& futures); // waits for any future - [[nodiscard]] TFuture<void> WaitAny(const TFuture<void>& f1); - [[nodiscard]] TFuture<void> WaitAny(const TFuture<void>& f1, const TFuture<void>& f2); + [[nodiscard]] TFuture<void> WaitAny(const TFuture<void>& f1); + [[nodiscard]] TFuture<void> WaitAny(const TFuture<void>& f1, const TFuture<void>& f2); [[nodiscard]] TFuture<void> WaitAny(TArrayRef<const TFuture<void>> futures); template <typename TContainer> [[nodiscard]] NImpl::EnableGenericWait<TContainer> WaitAny(const TContainer& futures); diff --git a/ydb/core/base/events.h b/ydb/core/base/events.h index 09561e2c57..f5fedfe19b 100644 --- a/ydb/core/base/events.h +++ b/ydb/core/base/events.h @@ -84,7 +84,7 @@ struct TKikimrEvents : TEvents { ES_GRPC_PROXY_STATUS, //OLD ES_SQS, ES_BLOCKSTORE, //4162 - ES_RTMR_ICBUS, + ES_RTMR_ICBUS, ES_TENANT_POOL, ES_USER_REGISTRY, ES_TVM_SETTINGS_UPDATER, diff --git a/ydb/core/base/hive.h b/ydb/core/base/hive.h index c81bd4a2ad..7464c76699 100644 --- a/ydb/core/base/hive.h +++ b/ydb/core/base/hive.h @@ -102,16 +102,16 @@ namespace NKikimr { TEvBootTabletReply() {} - TEvBootTabletReply(NKikimrProto::EReplyStatus status, const TString& msg = {}) + TEvBootTabletReply(NKikimrProto::EReplyStatus status, const TString& msg = {}) { Record.SetStatus(status); - Record.SetStatusMsg(msg); + Record.SetStatusMsg(msg); } TString ToString() const { TStringStream str; str << "{EvBootTabletReply Status: " << NKikimrProto::EReplyStatus_Name(Record.GetStatus()).data(); - str << " Msg: " << Record.GetStatusMsg(); + str << " Msg: " << Record.GetStatusMsg(); str << "}"; return str.Str(); } diff --git a/ydb/core/base/ticket_parser.h b/ydb/core/base/ticket_parser.h index 4f8e0f3187..62004b3a89 100644 --- a/ydb/core/base/ticket_parser.h +++ b/ydb/core/base/ticket_parser.h @@ -103,8 +103,8 @@ namespace NKikimr { } TString ToString() const { - return TStringBuilder() - << "{message:\"" << Message << "\",retryable:" << Retryable << "}"; + return TStringBuilder() + << "{message:\"" << Message << "\",retryable:" << Retryable << "}"; } }; diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index c9d726733d..819c1478d1 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -448,22 +448,22 @@ static TInterconnectSettings GetInterconnectSettings(const NKikimrConfig::TInter Cerr << "MaxTimePerEventInMks option is deprecated" << Endl; } - if (config.HasTotalInflightAmountOfData()) { - result.TotalInflightAmountOfData = config.GetTotalInflightAmountOfData(); - } - - if (config.HasPingPeriodDuration()) { - result.PingPeriod = DurationFromProto(config.GetPingPeriodDuration()); - } - - if (config.HasForceConfirmPeriodDuration()) { - result.ForceConfirmPeriod = DurationFromProto(config.GetForceConfirmPeriodDuration()); - } - - if (config.HasLostConnectionDuration()) { - result.LostConnection = DurationFromProto(config.GetLostConnectionDuration()); - } - + if (config.HasTotalInflightAmountOfData()) { + result.TotalInflightAmountOfData = config.GetTotalInflightAmountOfData(); + } + + if (config.HasPingPeriodDuration()) { + result.PingPeriod = DurationFromProto(config.GetPingPeriodDuration()); + } + + if (config.HasForceConfirmPeriodDuration()) { + result.ForceConfirmPeriod = DurationFromProto(config.GetForceConfirmPeriodDuration()); + } + + if (config.HasLostConnectionDuration()) { + result.LostConnection = DurationFromProto(config.GetLostConnectionDuration()); + } + if (config.HasBatchPeriodDuration()) { result.BatchPeriod = DurationFromProto(config.GetBatchPeriodDuration()); } else { diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index bca2bdd527..d64169d4fc 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -51,7 +51,7 @@ message TActorSystemConfig { optional uint64 SpinThreshold = 3; optional TAffinity Affinity = 4; optional uint32 InjectMadSquirrels = 5; - optional string Name = 6; + optional string Name = 6; optional uint32 TimePerMailboxMicroSecs = 7; optional uint32 EventsPerMailbox = 8; optional uint32 RealtimePriority = 9; @@ -408,11 +408,11 @@ message TInterconnectConfig { optional NKikimrConfigUnits.TDuration HeartbeatIntervalDuration = 22; optional NKikimrConfigUnits.TDuration DeadPeerTimeoutDuration = 23; optional NKikimrConfigUnits.TDuration CloseOnIdleTimeoutDuration = 24; - - optional uint64 TotalInflightAmountOfData = 25; - optional NKikimrConfigUnits.TDuration PingPeriodDuration = 26; - optional NKikimrConfigUnits.TDuration ForceConfirmPeriodDuration = 27; - optional NKikimrConfigUnits.TDuration LostConnectionDuration = 28; + + optional uint64 TotalInflightAmountOfData = 25; + optional NKikimrConfigUnits.TDuration PingPeriodDuration = 26; + optional NKikimrConfigUnits.TDuration ForceConfirmPeriodDuration = 27; + optional NKikimrConfigUnits.TDuration LostConnectionDuration = 28; optional NKikimrConfigUnits.TDuration BatchPeriodDuration = 29; } diff --git a/ydb/core/protos/filestore_config.proto b/ydb/core/protos/filestore_config.proto index fa4d90c14d..6154eb2039 100644 --- a/ydb/core/protos/filestore_config.proto +++ b/ydb/core/protos/filestore_config.proto @@ -1,15 +1,15 @@ package NKikimrFileStore; option java_package = "ru.yandex.kikimr.proto"; -message TChannelProfile { - // storage settings - optional string PoolKind = 1; - optional uint64 Size = 2; // size in bytes - optional double ReadIops = 3; // required iops for read requests - optional double ReadBandwidth = 4; // required bandwidth (in bytes/sec) for read requests - optional double WriteIops = 5; // required iops for write requests - optional double WriteBandwidth = 6; // required bandwidth (in bytes/sec) for write requests - optional uint32 DataKind = 7; // the kind of data to be stored, e.g. mixed/merged/etc. +message TChannelProfile { + // storage settings + optional string PoolKind = 1; + optional uint64 Size = 2; // size in bytes + optional double ReadIops = 3; // required iops for read requests + optional double ReadBandwidth = 4; // required bandwidth (in bytes/sec) for read requests + optional double WriteIops = 5; // required iops for write requests + optional double WriteBandwidth = 6; // required bandwidth (in bytes/sec) for write requests + optional uint32 DataKind = 7; // the kind of data to be stored, e.g. mixed/merged/etc. } message TConfig { @@ -30,17 +30,17 @@ message TConfig { optional uint32 RangeIdHasherType = 18; - repeated TChannelProfile ExplicitChannelProfiles = 30; - optional bool PoolKindChangeAllowed = 31; - - optional uint32 StorageMediaKind = 32; - - optional uint32 PerformanceProfileMaxReadBandwidth = 33; - optional uint32 PerformanceProfileMaxReadIops = 34; - optional uint32 PerformanceProfileMaxWriteBandwidth = 35; - optional uint32 PerformanceProfileMaxWriteIops = 36; - - optional uint32 NodesCount = 40; + repeated TChannelProfile ExplicitChannelProfiles = 30; + optional bool PoolKindChangeAllowed = 31; + + optional uint32 StorageMediaKind = 32; + + optional uint32 PerformanceProfileMaxReadBandwidth = 33; + optional uint32 PerformanceProfileMaxReadIops = 34; + optional uint32 PerformanceProfileMaxWriteBandwidth = 35; + optional uint32 PerformanceProfileMaxWriteIops = 36; + + optional uint32 NodesCount = 40; } message TUpdateConfig { diff --git a/ydb/core/protos/hive.proto b/ydb/core/protos/hive.proto index d15ff56165..0059db81de 100644 --- a/ydb/core/protos/hive.proto +++ b/ydb/core/protos/hive.proto @@ -60,7 +60,7 @@ message TEvBootTablet { message TEvBootTabletReply { optional NKikimrProto.EReplyStatus Status = 1; - optional string StatusMsg = 2; + optional string StatusMsg = 2; } message TTabletCategory { diff --git a/ydb/core/tablet/tablet_monitoring_proxy.cpp b/ydb/core/tablet/tablet_monitoring_proxy.cpp index a41ea63c48..a61a43b7e5 100644 --- a/ydb/core/tablet/tablet_monitoring_proxy.cpp +++ b/ydb/core/tablet/tablet_monitoring_proxy.cpp @@ -38,15 +38,15 @@ public: {} void Bootstrap(const TActorContext& ctx) { - NTabletPipe::TClientConfig config; + NTabletPipe::TClientConfig config; config.AllowFollower = ForceFollower; config.ForceFollower = ForceFollower; config.PreferLocal = Config.PreferLocal; config.RetryPolicy = Config.RetryPolicy; - - PipeClient = ctx.ExecutorThread.RegisterActor(NTabletPipe::CreateClient(ctx.SelfID, TargetTablet, config)); + + PipeClient = ctx.ExecutorThread.RegisterActor(NTabletPipe::CreateClient(ctx.SelfID, TargetTablet, config)); NTabletPipe::SendData(ctx, PipeClient, new NMon::TEvRemoteHttpInfo(Query, Method)); - + ctx.Schedule(TDuration::Seconds(60), new TEvents::TEvWakeup()); Become(&TThis::StateWork); } diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 0f63bc26f9..650506549e 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -3686,9 +3686,9 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { case ETabletType::BlockStorePartition2: Self->TabletCounters->Simple()[COUNTER_BLOCKSTORE_PARTITION2_SHARD_COUNT].Add(1); break; - case ETabletType::FileStore: - Self->TabletCounters->Simple()[COUNTER_FILESTORE_COUNT].Add(1); - break; + case ETabletType::FileStore: + Self->TabletCounters->Simple()[COUNTER_FILESTORE_COUNT].Add(1); + break; case ETabletType::Kesus: Self->TabletCounters->Simple()[COUNTER_KESUS_SHARD_COUNT].Add(1); break; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp index 43ee3b7425..ee2a3fb3e5 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp @@ -41,8 +41,8 @@ public: auto* txState = context.SS->FindTx(OperationId); Y_VERIFY(txState); - Y_VERIFY(txState->TxType == TTxState::TxAlterFileStore, "invalid tx type %u", txState->TxType); - Y_VERIFY(txState->State == TTxState::ConfigureParts, "invalid tx state %u", txState->State); + Y_VERIFY(txState->TxType == TTxState::TxAlterFileStore, "invalid tx type %u", txState->TxType); + Y_VERIFY(txState->State == TTxState::ConfigureParts, "invalid tx state %u", txState->State); auto tabletId = TTabletId(ev->Get()->Record.GetOrigin()); auto status = ev->Get()->Record.GetStatus(); @@ -278,25 +278,25 @@ private: TTxState& PrepareChanges( TOperationId operationId, TPathElement::TPtr item, TFileStoreInfo::TPtr fs, - const TChannelsBindings& partitionChannels, + const TChannelsBindings& partitionChannels, TOperationContext& context); const NKikimrFileStore::TConfig* ParseParams( const NKikimrSchemeOp::TFileStoreDescription& operation, TString& errStr); - - bool ProcessChannelProfiles( - const TPath& path, - const NKikimrFileStore::TConfig& config, - const NKikimrFileStore::TConfig& alterConfig, - TOperationContext& context, - TProposeResponse& result, - TChannelsBindings& storeChannelsBinding); - - void ApplyChannelBindings( - TFileStoreInfo::TPtr volume, - const TChannelsBindings& channelBindings, - TOperationContext& context); + + bool ProcessChannelProfiles( + const TPath& path, + const NKikimrFileStore::TConfig& config, + const NKikimrFileStore::TConfig& alterConfig, + TOperationContext& context, + TProposeResponse& result, + TChannelsBindings& storeChannelsBinding); + + void ApplyChannelBindings( + TFileStoreInfo::TPtr volume, + const TChannelsBindings& channelBindings, + TOperationContext& context); }; //////////////////////////////////////////////////////////////////////////////// @@ -380,26 +380,26 @@ THolder<TProposeResponse> TAlterFileStore::Propose( return result; } - if (alterConfig->HasVersion() && alterConfig->GetVersion() != fs->Version) { + if (alterConfig->HasVersion() && alterConfig->GetVersion() != fs->Version) { result->SetError( NKikimrScheme::StatusPreconditionFailed, "Wrong version in config"); return result; } - TChannelsBindings storeChannelsBinding; - const auto channelProfilesProcessed = ProcessChannelProfiles( - path, - fs->Config, - *alterConfig, - context, - *result, - storeChannelsBinding); - - if (!channelProfilesProcessed) { - return result; - } - + TChannelsBindings storeChannelsBinding; + const auto channelProfilesProcessed = ProcessChannelProfiles( + path, + fs->Config, + *alterConfig, + context, + *result, + storeChannelsBinding); + + if (!channelProfilesProcessed) { + return result; + } + if (!context.SS->CheckApplyIf(Transaction, errStr)) { result->SetError(NKikimrScheme::StatusPreconditionFailed, errStr); return result; @@ -407,7 +407,7 @@ THolder<TProposeResponse> TAlterFileStore::Propose( fs->PrepareAlter(*alterConfig); - PrepareChanges(OperationId, path.Base(), fs, storeChannelsBinding, context); + PrepareChanges(OperationId, path.Base(), fs, storeChannelsBinding, context); context.SS->ClearDescribePathCaches(path.Base()); context.OnComplete.PublishToSchemeBoard(OperationId, path.Base()->PathId); @@ -417,35 +417,35 @@ THolder<TProposeResponse> TAlterFileStore::Propose( return result; } -const NKikimrFileStore::TConfig* TAlterFileStore::ParseParams( +const NKikimrFileStore::TConfig* TAlterFileStore::ParseParams( const NKikimrSchemeOp::TFileStoreDescription& operation, - TString& errStr) -{ - if (operation.HasIndexTabletId() || operation.HasVersion()) { - errStr = "Setting schemeshard owned properties is not allowed"; - return nullptr; - } - - if (!operation.HasConfig()) { - errStr = "Missing changes to FileStore config"; - return nullptr; - } - - const auto& config = operation.GetConfig(); - - if (config.HasBlockSize()) { - errStr = "Cannot change block size after creation"; - return nullptr; - } - - return &config; -} - + TString& errStr) +{ + if (operation.HasIndexTabletId() || operation.HasVersion()) { + errStr = "Setting schemeshard owned properties is not allowed"; + return nullptr; + } + + if (!operation.HasConfig()) { + errStr = "Missing changes to FileStore config"; + return nullptr; + } + + const auto& config = operation.GetConfig(); + + if (config.HasBlockSize()) { + errStr = "Cannot change block size after creation"; + return nullptr; + } + + return &config; +} + TTxState& TAlterFileStore::PrepareChanges( TOperationId operationId, TPathElement::TPtr item, TFileStoreInfo::TPtr fs, - const TChannelsBindings& channelBindings, + const TChannelsBindings& channelBindings, TOperationContext& context) { NIceDb::TNiceDb db(context.Txc.DB); @@ -456,11 +456,11 @@ TTxState& TAlterFileStore::PrepareChanges( TTxState& txState = context.SS->CreateTx(OperationId, TTxState::TxAlterFileStore, item->PathId); txState.State = TTxState::CreateParts; - ApplyChannelBindings( - fs, - channelBindings, - context); - + ApplyChannelBindings( + fs, + channelBindings, + context); + txState.Shards.reserve(1); { TShardIdx shardIdx = fs->IndexShardIdx; @@ -485,85 +485,85 @@ TTxState& TAlterFileStore::PrepareChanges( return txState; } -bool TAlterFileStore::ProcessChannelProfiles( - const TPath& path, - const NKikimrFileStore::TConfig& config, - const NKikimrFileStore::TConfig& alterConfig, - TOperationContext& context, - TProposeResponse& result, - TChannelsBindings& storeChannelsBinding) +bool TAlterFileStore::ProcessChannelProfiles( + const TPath& path, + const NKikimrFileStore::TConfig& config, + const NKikimrFileStore::TConfig& alterConfig, + TOperationContext& context, + TProposeResponse& result, + TChannelsBindings& storeChannelsBinding) { - const auto& alterEcps = alterConfig.GetExplicitChannelProfiles(); - - if (alterEcps.size()) { - if (ui32(alterEcps.size()) > NHive::MAX_TABLET_CHANNELS) { - auto errStr = Sprintf("Wrong number of channels %u , should be [1 .. %lu]", - alterEcps.size(), NHive::MAX_TABLET_CHANNELS); - + const auto& alterEcps = alterConfig.GetExplicitChannelProfiles(); + + if (alterEcps.size()) { + if (ui32(alterEcps.size()) > NHive::MAX_TABLET_CHANNELS) { + auto errStr = Sprintf("Wrong number of channels %u , should be [1 .. %lu]", + alterEcps.size(), NHive::MAX_TABLET_CHANNELS); + result.SetError(NKikimrScheme::StatusInvalidParameter, errStr); - return false; - } - - // Cannot delete explicit profiles for existing channels - if (alterConfig.ExplicitChannelProfilesSize() < config.ExplicitChannelProfilesSize()) { + return false; + } + + // Cannot delete explicit profiles for existing channels + if (alterConfig.ExplicitChannelProfilesSize() < config.ExplicitChannelProfilesSize()) { result.SetError(NKikimrScheme::StatusInvalidParameter, - "Cannot reduce the number of channel profiles"); - return false; - } - - if (!alterConfig.GetPoolKindChangeAllowed()) { - // Cannot change pool kinds for existing channels - // But it's ok to change other params, e.g. DataKind - for (ui32 i = 0; i < config.ExplicitChannelProfilesSize(); ++i) { - const auto& prevProfile = config.GetExplicitChannelProfiles(i); - const auto& newProfile = alterConfig.GetExplicitChannelProfiles(i); - if (prevProfile.GetPoolKind() != newProfile.GetPoolKind()) { - result.SetError( + "Cannot reduce the number of channel profiles"); + return false; + } + + if (!alterConfig.GetPoolKindChangeAllowed()) { + // Cannot change pool kinds for existing channels + // But it's ok to change other params, e.g. DataKind + for (ui32 i = 0; i < config.ExplicitChannelProfilesSize(); ++i) { + const auto& prevProfile = config.GetExplicitChannelProfiles(i); + const auto& newProfile = alterConfig.GetExplicitChannelProfiles(i); + if (prevProfile.GetPoolKind() != newProfile.GetPoolKind()) { + result.SetError( NKikimrScheme::StatusInvalidParameter, - TStringBuilder() << "Cannot change PoolKind for channel " << i - << ", " << prevProfile.GetPoolKind() - << " -> " << newProfile.GetPoolKind()); - - return false; - } - } - } + TStringBuilder() << "Cannot change PoolKind for channel " << i + << ", " << prevProfile.GetPoolKind() + << " -> " << newProfile.GetPoolKind()); + + return false; + } + } + } } - const auto& ecps = alterEcps.empty() ? config.GetExplicitChannelProfiles() : alterEcps; - TVector<TStringBuf> partitionPoolKinds(Reserve(ecps.size())); - for (const auto& ecp : ecps) { - partitionPoolKinds.push_back(ecp.GetPoolKind()); + const auto& ecps = alterEcps.empty() ? config.GetExplicitChannelProfiles() : alterEcps; + TVector<TStringBuf> partitionPoolKinds(Reserve(ecps.size())); + for (const auto& ecp : ecps) { + partitionPoolKinds.push_back(ecp.GetPoolKind()); } - const auto storeChannelsResolved = context.SS->ResolveChannelsByPoolKinds( - partitionPoolKinds, - path.DomainId(), - storeChannelsBinding); + const auto storeChannelsResolved = context.SS->ResolveChannelsByPoolKinds( + partitionPoolKinds, + path.DomainId(), + storeChannelsBinding); - if (!storeChannelsResolved) { + if (!storeChannelsResolved) { result.SetError(NKikimrScheme::StatusInvalidParameter, - "Unable to construct channel binding for filestore with the storage pool"); - return false; + "Unable to construct channel binding for filestore with the storage pool"); + return false; } - context.SS->SetNfsChannelsParams(ecps, storeChannelsBinding); - return true; + context.SS->SetNfsChannelsParams(ecps, storeChannelsBinding); + return true; +} + +void TAlterFileStore::ApplyChannelBindings( + TFileStoreInfo::TPtr fs, + const TChannelsBindings& channelBindings, + TOperationContext& context) +{ + auto& shardInfo = context.SS->ShardInfos[fs->IndexShardIdx]; + if (!shardInfo.BindedChannels.empty()) { + Y_VERIFY(shardInfo.BindedChannels.size() <= channelBindings.size()); + shardInfo.BindedChannels.resize(channelBindings.size()); + Copy(channelBindings.begin(), channelBindings.end(), shardInfo.BindedChannels.begin()); + } } -void TAlterFileStore::ApplyChannelBindings( - TFileStoreInfo::TPtr fs, - const TChannelsBindings& channelBindings, - TOperationContext& context) -{ - auto& shardInfo = context.SS->ShardInfos[fs->IndexShardIdx]; - if (!shardInfo.BindedChannels.empty()) { - Y_VERIFY(shardInfo.BindedChannels.size() <= channelBindings.size()); - shardInfo.BindedChannels.resize(channelBindings.size()); - Copy(channelBindings.begin(), channelBindings.end(), shardInfo.BindedChannels.begin()); - } -} - } // namespace namespace NKikimr { diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp index 0be3bab97a..6d908a55e8 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp @@ -388,35 +388,35 @@ THolder<TProposeResponse> TCreateFileStore::Propose( } } - const auto& ecps = operation.GetConfig().GetExplicitChannelProfiles(); - if (ecps.empty() || ui32(ecps.size()) > NHive::MAX_TABLET_CHANNELS) { - auto errStr = Sprintf("Wrong number of channels %u , should be [1 .. %lu]", - ecps.size(), NHive::MAX_TABLET_CHANNELS); - + const auto& ecps = operation.GetConfig().GetExplicitChannelProfiles(); + if (ecps.empty() || ui32(ecps.size()) > NHive::MAX_TABLET_CHANNELS) { + auto errStr = Sprintf("Wrong number of channels %u , should be [1 .. %lu]", + ecps.size(), NHive::MAX_TABLET_CHANNELS); + result->SetError(NKikimrScheme::StatusInvalidParameter, errStr); - return result; - } - - TVector<TStringBuf> storePoolKinds(Reserve(ecps.size())); - for (const auto& ecp : ecps) { - storePoolKinds.push_back(ecp.GetPoolKind()); - } - - TChannelsBindings storeChannelBindings; - const auto storeChannelsResolved = context.SS->ResolveChannelsByPoolKinds( - storePoolKinds, - dstPath.DomainId(), - storeChannelBindings - ); - - if (!storeChannelsResolved) { + return result; + } + + TVector<TStringBuf> storePoolKinds(Reserve(ecps.size())); + for (const auto& ecp : ecps) { + storePoolKinds.push_back(ecp.GetPoolKind()); + } + + TChannelsBindings storeChannelBindings; + const auto storeChannelsResolved = context.SS->ResolveChannelsByPoolKinds( + storePoolKinds, + dstPath.DomainId(), + storeChannelBindings + ); + + if (!storeChannelsResolved) { result->SetError(NKikimrScheme::StatusInvalidParameter, - "Unable to construct channel binding for filestore with the storage pool"); + "Unable to construct channel binding for filestore with the storage pool"); return result; } - context.SS->SetNfsChannelsParams(ecps, storeChannelBindings); - + context.SS->SetNfsChannelsParams(ecps, storeChannelBindings); + TString errStr; if (!context.SS->CheckApplyIf(Transaction, errStr)) { result->SetError(NKikimrScheme::StatusPreconditionFailed, errStr); @@ -440,7 +440,7 @@ THolder<TProposeResponse> TCreateFileStore::Propose( dstPath.Base(), fs, acl, - storeChannelBindings, + storeChannelBindings, context); NIceDb::TNiceDb db(context.Txc.DB); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp index d3220d39bf..4ba51deb84 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp @@ -313,8 +313,8 @@ THolder<TProposeResponse> TDropFileStore::Propose( { auto shardIdx = fs->IndexShardIdx; - Y_VERIFY_S(context.SS->ShardInfos.count(shardIdx), "invalid schemeshard idx " << shardIdx << " at " << path.Base()->PathId); - + Y_VERIFY_S(context.SS->ShardInfos.count(shardIdx), "invalid schemeshard idx " << shardIdx << " at " << path.Base()->PathId); + txState.Shards.emplace_back(shardIdx, context.SS->ShardInfos.at(shardIdx).TabletType, txState.State); context.SS->ShardInfos.at(shardIdx).CurrentTxId = OperationId.GetTxId(); diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 8e97531ee4..0715543a22 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -824,24 +824,24 @@ void TSchemeShard::SetNbsChannelsParams( } void TSchemeShard::SetNfsChannelsParams( - const google::protobuf::RepeatedPtrField<NKikimrFileStore::TChannelProfile>& ecps, - TChannelsBindings& channelsBinding) -{ - Y_VERIFY(channelsBinding.ysize() == ecps.size()); - - for (int i = 0; i < ecps.size(); ++i) { - channelsBinding[i].SetSize(ecps[i].GetSize()); - // XXX IOPS and Throughput should be split into read/write IOPS - // and read/write Throughput in Hive - channelsBinding[i].SetThroughput( - ecps[i].GetReadBandwidth() + ecps[i].GetWriteBandwidth() - ); - channelsBinding[i].SetIOPS( - ecps[i].GetReadIops() + ecps[i].GetWriteIops() - ); - } -} - + const google::protobuf::RepeatedPtrField<NKikimrFileStore::TChannelProfile>& ecps, + TChannelsBindings& channelsBinding) +{ + Y_VERIFY(channelsBinding.ysize() == ecps.size()); + + for (int i = 0; i < ecps.size(); ++i) { + channelsBinding[i].SetSize(ecps[i].GetSize()); + // XXX IOPS and Throughput should be split into read/write IOPS + // and read/write Throughput in Hive + channelsBinding[i].SetThroughput( + ecps[i].GetReadBandwidth() + ecps[i].GetWriteBandwidth() + ); + channelsBinding[i].SetIOPS( + ecps[i].GetReadIops() + ecps[i].GetWriteIops() + ); + } +} + void TSchemeShard::SetPqChannelsParams( const google::protobuf::RepeatedPtrField<NKikimrPQ::TChannelProfile>& ecps, TChannelsBindings& channelsBinding) diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.h b/ydb/core/tx/schemeshard/schemeshard_impl.h index 770bb65322..e1a1d08b9a 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.h +++ b/ydb/core/tx/schemeshard/schemeshard_impl.h @@ -340,9 +340,9 @@ public: static void SetNbsChannelsParams( const google::protobuf::RepeatedPtrField<NKikimrBlockStore::TChannelProfile>& ecps, TChannelsBindings& channelsBinding); - static void SetNfsChannelsParams( - const google::protobuf::RepeatedPtrField<NKikimrFileStore::TChannelProfile>& ecps, - TChannelsBindings& channelsBinding); + static void SetNfsChannelsParams( + const google::protobuf::RepeatedPtrField<NKikimrFileStore::TChannelProfile>& ecps, + TChannelsBindings& channelsBinding); static void SetPqChannelsParams( const google::protobuf::RepeatedPtrField<NKikimrPQ::TChannelProfile>& ecps, TChannelsBindings& channelsBinding); diff --git a/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp b/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp index 169dc53ef0..0fdfd871de 100644 --- a/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp @@ -1,255 +1,255 @@ #include <ydb/core/tx/schemeshard/ut_helpers/helpers.h> - + #include <ydb/core/protos/flat_scheme_op.pb.h> - -#include <google/protobuf/text_format.h> - -using namespace NKikimr; + +#include <google/protobuf/text_format.h> + +using namespace NKikimr; using namespace NSchemeShard; -using namespace NSchemeShardUT_Private; - -namespace { - -auto& InitCreateFileStoreConfig( - const TString& name, +using namespace NSchemeShardUT_Private; + +namespace { + +auto& InitCreateFileStoreConfig( + const TString& name, NKikimrSchemeOp::TFileStoreDescription& vdescr) -{ - vdescr.SetName(name); - auto& vc = *vdescr.MutableConfig(); - vc.SetBlockSize(4096); - vc.SetBlocksCount(4096); - vc.SetFileSystemId(name); - vc.SetCloudId("cloud"); - vc.SetFolderId("folder"); - - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); - - return vc; -} - -void InitAlterFileStoreConfig(NKikimrFileStore::TConfig& vc, bool channels = false) -{ - vc.Clear(); - vc.SetVersion(1); - vc.SetCloudId("baz"); - vc.SetFolderId("bar"); - - if (channels) { - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); - vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); - } -} - -} // namespace - -Y_UNIT_TEST_SUITE(TFileStoreWithReboots) { - Y_UNIT_TEST(Create) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - t.RestoreLogging(); - +{ + vdescr.SetName(name); + auto& vc = *vdescr.MutableConfig(); + vc.SetBlockSize(4096); + vc.SetBlocksCount(4096); + vc.SetFileSystemId(name); + vc.SetCloudId("cloud"); + vc.SetFolderId("folder"); + + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); + + return vc; +} + +void InitAlterFileStoreConfig(NKikimrFileStore::TConfig& vc, bool channels = false) +{ + vc.Clear(); + vc.SetVersion(1); + vc.SetCloudId("baz"); + vc.SetFolderId("bar"); + + if (channels) { + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); + vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-2"); + } +} + +} // namespace + +Y_UNIT_TEST_SUITE(TFileStoreWithReboots) { + Y_UNIT_TEST(Create) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + t.RestoreLogging(); + NKikimrSchemeOp::TFileStoreDescription vdescr; - InitCreateFileStoreConfig("FS_1", vdescr); - TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - activeZone = false; - TestLs(runtime, "/MyRoot/DirA/FS_1", false, NLs::Finished); - }); - } - - Y_UNIT_TEST(CreateAlter) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - t.RestoreLogging(); - + InitCreateFileStoreConfig("FS_1", vdescr); + TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + activeZone = false; + TestLs(runtime, "/MyRoot/DirA/FS_1", false, NLs::Finished); + }); + } + + Y_UNIT_TEST(CreateAlter) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + t.RestoreLogging(); + NKikimrSchemeOp::TFileStoreDescription vdescr; - auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); - TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); - - InitAlterFileStoreConfig(vc); - TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - activeZone = false; - TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/FS_2"), - {NLs::PathExist, - NLs::Finished, - NLs::PathVersionEqual(3)}); - }); - } - - Y_UNIT_TEST(CreateAlterNoVersion) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - t.RestoreLogging(); - + auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); + TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); + + InitAlterFileStoreConfig(vc); + TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + activeZone = false; + TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/FS_2"), + {NLs::PathExist, + NLs::Finished, + NLs::PathVersionEqual(3)}); + }); + } + + Y_UNIT_TEST(CreateAlterNoVersion) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + t.RestoreLogging(); + NKikimrSchemeOp::TFileStoreDescription vdescr; - auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); - TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); - - InitAlterFileStoreConfig(vc); - TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - activeZone = false; - TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::PathExist); - }); - } - - Y_UNIT_TEST(CreateDrop) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - t.RestoreLogging(); - + auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); + TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); + + InitAlterFileStoreConfig(vc); + TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + activeZone = false; + TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::PathExist); + }); + } + + Y_UNIT_TEST(CreateDrop) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + t.RestoreLogging(); + NKikimrSchemeOp::TFileStoreDescription vdescr; - InitCreateFileStoreConfig("FS_3", vdescr); - TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - TestLs(runtime, "/MyRoot/DirA/FS_3", false, NLs::Finished); - - TestDropFileStore(runtime, t.TxId++, "/MyRoot/DirA", "FS_3"); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - activeZone = false; - TestLs(runtime, "/MyRoot/DirA/FS_3", false, NLs::PathNotExist); - }); - } - - - Y_UNIT_TEST(CreateWithIntermediateDirs) { + InitCreateFileStoreConfig("FS_3", vdescr); + TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + TestLs(runtime, "/MyRoot/DirA/FS_3", false, NLs::Finished); + + TestDropFileStore(runtime, t.TxId++, "/MyRoot/DirA", "FS_3"); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + activeZone = false; + TestLs(runtime, "/MyRoot/DirA/FS_3", false, NLs::PathNotExist); + }); + } + + + Y_UNIT_TEST(CreateWithIntermediateDirs) { NKikimrSchemeOp::TFileStoreDescription vdescr; - InitCreateFileStoreConfig("Valid/x/y/z", vdescr); - const auto validScheme = vdescr.DebugString(); - vdescr.Clear(); - InitCreateFileStoreConfig("Invalid/wr0ng n@me", vdescr); - const auto invalidScheme = vdescr.DebugString(); + InitCreateFileStoreConfig("Valid/x/y/z", vdescr); + const auto validScheme = vdescr.DebugString(); + vdescr.Clear(); + InitCreateFileStoreConfig("Invalid/wr0ng n@me", vdescr); + const auto invalidScheme = vdescr.DebugString(); const auto validStatus = NKikimrScheme::StatusAccepted; const auto invalidStatus = NKikimrScheme::StatusSchemeError; - - CreateWithIntermediateDirs([&](TTestActorRuntime& runtime, ui64 txId, const TString& root, bool valid) { - TestCreateFileStore(runtime, txId, root, valid ? validScheme : invalidScheme, {valid ? validStatus : invalidStatus}); - }); - } - - Y_UNIT_TEST(CreateWithIntermediateDirsForceDrop) { - CreateWithIntermediateDirsForceDrop( - [](TTestActorRuntime& runtime, ui64 txId, const TString& root) { + + CreateWithIntermediateDirs([&](TTestActorRuntime& runtime, ui64 txId, const TString& root, bool valid) { + TestCreateFileStore(runtime, txId, root, valid ? validScheme : invalidScheme, {valid ? validStatus : invalidStatus}); + }); + } + + Y_UNIT_TEST(CreateWithIntermediateDirsForceDrop) { + CreateWithIntermediateDirsForceDrop( + [](TTestActorRuntime& runtime, ui64 txId, const TString& root) { NKikimrSchemeOp::TFileStoreDescription vdescr; - InitCreateFileStoreConfig("x/y/z", vdescr); - AsyncCreateFileStore(runtime, txId, root, vdescr.DebugString()); - }); - } - - Y_UNIT_TEST(SimultaneousCreateDropNfs) { //+ - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - { - TInactiveZone inactive(activeZone); - TestCreateSubDomain(runtime, ++t.TxId, "/MyRoot/DirA", - "PlanResolution: 50 " - "Coordinators: 1 " - "Mediators: 1 " - "TimeCastBucketsPerMediator: 2 " - "Name: \"USER_0\"" - "StoragePools {" - " Name: \"name_USER_0_kind_hdd-1\"" - " Kind: \"storage-pool-number-1\"" - "}" - "StoragePools {" - " Name: \"name_USER_0_kind_hdd-2\"" - " Kind: \"storage-pool-number-2\"" - "}"); - t.TestEnv->TestWaitNotification(runtime, t.TxId); - } - + InitCreateFileStoreConfig("x/y/z", vdescr); + AsyncCreateFileStore(runtime, txId, root, vdescr.DebugString()); + }); + } + + Y_UNIT_TEST(SimultaneousCreateDropNfs) { //+ + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + { + TInactiveZone inactive(activeZone); + TestCreateSubDomain(runtime, ++t.TxId, "/MyRoot/DirA", + "PlanResolution: 50 " + "Coordinators: 1 " + "Mediators: 1 " + "TimeCastBucketsPerMediator: 2 " + "Name: \"USER_0\"" + "StoragePools {" + " Name: \"name_USER_0_kind_hdd-1\"" + " Kind: \"storage-pool-number-1\"" + "}" + "StoragePools {" + " Name: \"name_USER_0_kind_hdd-2\"" + " Kind: \"storage-pool-number-2\"" + "}"); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + } + NKikimrSchemeOp::TFileStoreDescription vdescr; - InitCreateFileStoreConfig("FS_1", vdescr); - TestCreateFileStore(runtime, ++t.TxId, "/MyRoot/DirA/USER_0", vdescr.DebugString()); - - TestForceDropSubDomain(runtime, ++t.TxId, "/MyRoot/DirA", "USER_0"); - - t.TestEnv->TestWaitNotification(runtime, {t.TxId, t.TxId-1}); + InitCreateFileStoreConfig("FS_1", vdescr); + TestCreateFileStore(runtime, ++t.TxId, "/MyRoot/DirA/USER_0", vdescr.DebugString()); + + TestForceDropSubDomain(runtime, ++t.TxId, "/MyRoot/DirA", "USER_0"); + + t.TestEnv->TestWaitNotification(runtime, {t.TxId, t.TxId-1}); t.TestEnv->TestWaitTabletDeletion(runtime, xrange(TTestTxConfig::FakeHiveTablets, TTestTxConfig::FakeHiveTablets + 3)); - - { - TInactiveZone inactive(activeZone); - TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/USER_0"), - {NLs::PathNotExist}); - - TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), + + { + TInactiveZone inactive(activeZone); + TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/USER_0"), + {NLs::PathNotExist}); + + TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::PathVersionEqual(7), - NLs::PathsInsideDomain(1), - NLs::ShardsInsideDomain(0)}); - } - }); - } - - Y_UNIT_TEST(AlterAssignDrop) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + NLs::PathsInsideDomain(1), + NLs::ShardsInsideDomain(0)}); + } + }); + } + + Y_UNIT_TEST(AlterAssignDrop) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { NKikimrSchemeOp::TFileStoreDescription vdescr; - auto& vc = InitCreateFileStoreConfig("FS", vdescr); - - { - TInactiveZone inactive(activeZone); - t.RestoreLogging(); - TestCreateFileStore(runtime, ++t.TxId, "/MyRoot", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId); - } - - InitAlterFileStoreConfig(vc); - AsyncAlterFileStore(runtime, ++t.TxId, "/MyRoot", vdescr.DebugString()); - + auto& vc = InitCreateFileStoreConfig("FS", vdescr); + + { + TInactiveZone inactive(activeZone); + t.RestoreLogging(); + TestCreateFileStore(runtime, ++t.TxId, "/MyRoot", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + } + + InitAlterFileStoreConfig(vc); + AsyncAlterFileStore(runtime, ++t.TxId, "/MyRoot", vdescr.DebugString()); + TestDropFileStore(runtime, ++t.TxId, "/MyRoot", "FS", {NKikimrScheme::StatusMultipleModifications, NKikimrScheme::StatusAccepted}); - t.TestEnv->TestWaitNotification(runtime, t.TxId); - - t.TestEnv->TestWaitNotification(runtime, t.TxId - 1); // wait Alter - - { - TInactiveZone inactive(activeZone); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + + t.TestEnv->TestWaitNotification(runtime, t.TxId - 1); // wait Alter + + { + TInactiveZone inactive(activeZone); TestDropFileStore(runtime, ++t.TxId, "/MyRoot", "FS", {NKikimrScheme::StatusPathDoesNotExist, NKikimrScheme::StatusAccepted}); - t.TestEnv->TestWaitNotification(runtime, t.TxId); - TestDescribeResult(DescribePath(runtime, "/MyRoot/FS"), - {NLs::PathNotExist}); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + TestDescribeResult(DescribePath(runtime, "/MyRoot/FS"), + {NLs::PathNotExist}); t.TestEnv->TestWaitTabletDeletion(runtime, xrange(TTestTxConfig::FakeHiveTablets, TTestTxConfig::FakeHiveTablets+5)); - } - }); - } - - Y_UNIT_TEST(CreateAlterChannels) { - TTestWithReboots t; - t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { - t.RestoreLogging(); - + } + }); + } + + Y_UNIT_TEST(CreateAlterChannels) { + TTestWithReboots t; + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + t.RestoreLogging(); + NKikimrSchemeOp::TFileStoreDescription vdescr; - auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); - TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); - - InitAlterFileStoreConfig(vc, true); - TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); - t.TestEnv->TestWaitNotification(runtime, t.TxId-1); - - activeZone = false; - TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/FS_2"), - {NLs::PathExist, - NLs::Finished, - NLs::PathVersionEqual(3)}); - }); - } -} + auto& vc = InitCreateFileStoreConfig("FS_2", vdescr); + TestCreateFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + TestLs(runtime, "/MyRoot/DirA/FS_2", false, NLs::Finished); + + InitAlterFileStoreConfig(vc, true); + TestAlterFileStore(runtime, t.TxId++, "/MyRoot/DirA", vdescr.DebugString()); + t.TestEnv->TestWaitNotification(runtime, t.TxId-1); + + activeZone = false; + TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/FS_2"), + {NLs::PathExist, + NLs::Finished, + NLs::PathVersionEqual(3)}); + }); + } +} diff --git a/ydb/core/tx/schemeshard/ut_filestore_reboots/ya.make b/ydb/core/tx/schemeshard/ut_filestore_reboots/ya.make index b3b5b13d6a..70b9eb07a5 100644 --- a/ydb/core/tx/schemeshard/ut_filestore_reboots/ya.make +++ b/ydb/core/tx/schemeshard/ut_filestore_reboots/ya.make @@ -1,15 +1,15 @@ -IF (NOT WITH_VALGRIND) +IF (NOT WITH_VALGRIND) UNITTEST_FOR(ydb/core/tx/schemeshard) - + OWNER( vvvv g:kikimr ) - + FORK_SUBTESTS() - + SPLIT_FACTOR(60) - + IF (SANITIZER_TYPE OR WITH_VALGRIND) TIMEOUT(3600) SIZE(LARGE) @@ -18,7 +18,7 @@ IF (NOT WITH_VALGRIND) TIMEOUT(600) SIZE(MEDIUM) ENDIF() - + PEERDIR( library/cpp/getopt library/cpp/regex/pcre @@ -28,12 +28,12 @@ IF (NOT WITH_VALGRIND) ydb/core/tx/schemeshard/ut_helpers ydb/library/yql/public/udf/service/exception_policy ) - + YQL_LAST_ABI_VERSION() - + SRCS( ut_filestore_reboots.cpp ) - + END() -ENDIF() +ENDIF() diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp index 8d6a8e954f..9cfd8037b7 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp @@ -95,76 +95,76 @@ private: TDeque<TAutoPtr<IEventHandle>> InitialEventsQueue; }; -class TFakeFileStore : public TActor<TFakeFileStore>, public NTabletFlatExecutor::TTabletExecutedFlat { -public: - TFakeFileStore(const TActorId& tablet, TTabletStorageInfo* info) - : TActor(&TThis::StateInit) - , TTabletExecutedFlat(info, tablet, new NMiniKQL::TMiniKQLFactory) - {} - - void OnActivateExecutor(const TActorContext& ctx) override { - Become(&TThis::StateWork); - - while (!InitialEventsQueue.empty()) { - TAutoPtr<IEventHandle>& ev = InitialEventsQueue.front(); - ctx.ExecutorThread.Send(ev.Release()); - InitialEventsQueue.pop_front(); - } - } - - void OnDetach(const TActorContext& ctx) override { - Die(ctx); - } - - void OnTabletDead(TEvTablet::TEvTabletDead::TPtr& ev, const TActorContext& ctx) override { - Y_UNUSED(ev); - Die(ctx); - } - - void Enqueue(STFUNC_SIG) override { - Y_UNUSED(ctx); - InitialEventsQueue.push_back(ev); - } - - STFUNC(StateInit) { - StateInitImpl(ev, ctx); - } - - STFUNC(StateWork) { - switch (ev->GetTypeRewrite()) { - HFunc(TEvTablet::TEvTabletDead, HandleTabletDead); - HFunc(TEvFileStore::TEvUpdateConfig, Handle); - HFunc(TEvents::TEvPoisonPill, Handle); - } - } - - STFUNC(StateBroken) { - switch (ev->GetTypeRewrite()) { - HFunc(TEvTablet::TEvTabletDead, HandleTabletDead); - } - } - -private: - void Handle(TEvFileStore::TEvUpdateConfig::TPtr& ev, const TActorContext& ctx) { - const auto& request = ev->Get()->Record; - TAutoPtr<TEvFileStore::TEvUpdateConfigResponse> response = - new TEvFileStore::TEvUpdateConfigResponse(); - response->Record.SetTxId(request.GetTxId()); - response->Record.SetOrigin(TabletID()); - response->Record.SetStatus(NKikimrFileStore::OK); - ctx.Send(ev->Sender, response.Release()); - } - - void Handle(TEvents::TEvPoisonPill::TPtr& ev, const TActorContext& ctx) { - Y_UNUSED(ev); - Become(&TThis::StateBroken); - ctx.Send(Tablet(), new TEvents::TEvPoisonPill()); - } - -private: - TDeque<TAutoPtr<IEventHandle>> InitialEventsQueue; -}; - +class TFakeFileStore : public TActor<TFakeFileStore>, public NTabletFlatExecutor::TTabletExecutedFlat { +public: + TFakeFileStore(const TActorId& tablet, TTabletStorageInfo* info) + : TActor(&TThis::StateInit) + , TTabletExecutedFlat(info, tablet, new NMiniKQL::TMiniKQLFactory) + {} + + void OnActivateExecutor(const TActorContext& ctx) override { + Become(&TThis::StateWork); + + while (!InitialEventsQueue.empty()) { + TAutoPtr<IEventHandle>& ev = InitialEventsQueue.front(); + ctx.ExecutorThread.Send(ev.Release()); + InitialEventsQueue.pop_front(); + } + } + + void OnDetach(const TActorContext& ctx) override { + Die(ctx); + } + + void OnTabletDead(TEvTablet::TEvTabletDead::TPtr& ev, const TActorContext& ctx) override { + Y_UNUSED(ev); + Die(ctx); + } + + void Enqueue(STFUNC_SIG) override { + Y_UNUSED(ctx); + InitialEventsQueue.push_back(ev); + } + + STFUNC(StateInit) { + StateInitImpl(ev, ctx); + } + + STFUNC(StateWork) { + switch (ev->GetTypeRewrite()) { + HFunc(TEvTablet::TEvTabletDead, HandleTabletDead); + HFunc(TEvFileStore::TEvUpdateConfig, Handle); + HFunc(TEvents::TEvPoisonPill, Handle); + } + } + + STFUNC(StateBroken) { + switch (ev->GetTypeRewrite()) { + HFunc(TEvTablet::TEvTabletDead, HandleTabletDead); + } + } + +private: + void Handle(TEvFileStore::TEvUpdateConfig::TPtr& ev, const TActorContext& ctx) { + const auto& request = ev->Get()->Record; + TAutoPtr<TEvFileStore::TEvUpdateConfigResponse> response = + new TEvFileStore::TEvUpdateConfigResponse(); + response->Record.SetTxId(request.GetTxId()); + response->Record.SetOrigin(TabletID()); + response->Record.SetStatus(NKikimrFileStore::OK); + ctx.Send(ev->Sender, response.Release()); + } + + void Handle(TEvents::TEvPoisonPill::TPtr& ev, const TActorContext& ctx) { + Y_UNUSED(ev); + Become(&TThis::StateBroken); + ctx.Send(Tablet(), new TEvents::TEvPoisonPill()); + } + +private: + TDeque<TAutoPtr<IEventHandle>> InitialEventsQueue; +}; + // Automatically resend notification requests to Schemeshard if it gets restarted class TTxNotificationSubscriber : public TActor<TTxNotificationSubscriber> { public: @@ -768,10 +768,10 @@ std::function<NActors::IActor *(const NActors::TActorId &, NKikimr::TTabletStora return [](const TActorId& tablet, TTabletStorageInfo* info) { return new TFakeBlockStoreVolume(tablet, info); }; - case TTabletTypes::FileStore: - return [](const TActorId& tablet, TTabletStorageInfo* info) { - return new TFakeFileStore(tablet, info); - }; + case TTabletTypes::FileStore: + return [](const TActorId& tablet, TTabletStorageInfo* info) { + return new TFakeFileStore(tablet, info); + }; default: return nullptr; } diff --git a/ydb/core/tx/schemeshard/ya.make b/ydb/core/tx/schemeshard/ya.make index 6e9c1d797a..ceb87ce388 100644 --- a/ydb/core/tx/schemeshard/ya.make +++ b/ydb/core/tx/schemeshard/ya.make @@ -1,4 +1,4 @@ -RECURSE_FOR_TESTS( +RECURSE_FOR_TESTS( ut_async_index ut_base ut_base_reboots @@ -9,38 +9,38 @@ RECURSE_FOR_TESTS( ut_compaction ut_export ut_export_reboots_s3 - ut_extsubdomain - ut_extsubdomain_reboots - ut_filestore_reboots - ut_index_build - ut_index_build_reboots + ut_extsubdomain + ut_extsubdomain_reboots + ut_filestore_reboots + ut_index_build + ut_index_build_reboots ut_login ut_move ut_move_reboots - ut_olap + ut_olap ut_olap_reboots - ut_pq - ut_pq_reboots - ut_reboots + ut_pq + ut_pq_reboots + ut_reboots ut_replication ut_replication_reboots ut_restore - ut_rtmr - ut_rtmr_reboots + ut_rtmr + ut_rtmr_reboots ut_ru_calculator ut_sequence ut_sequence_reboots - ut_serverless - ut_split_merge - ut_split_merge_reboots - ut_subdomain - ut_subdomain_reboots - ut_ttl - ut_upgradesubdomain - ut_upgradesubdomain_reboots - ut_user_attributes - ut_user_attributes_reboots -) + ut_serverless + ut_split_merge + ut_split_merge_reboots + ut_subdomain + ut_subdomain_reboots + ut_ttl + ut_upgradesubdomain + ut_upgradesubdomain_reboots + ut_user_attributes + ut_user_attributes_reboots +) LIBRARY() diff --git a/ydb/library/yql/providers/common/proto/gateways_config.proto b/ydb/library/yql/providers/common/proto/gateways_config.proto index c2cb7cb2cd..8561fe2536 100644 --- a/ydb/library/yql/providers/common/proto/gateways_config.proto +++ b/ydb/library/yql/providers/common/proto/gateways_config.proto @@ -244,7 +244,7 @@ message TRtmrGatewayConfig { repeated TAttr DefaultSettings = 2; optional string YqlRtmrDynLib = 3; // path to libyql-dynlib.so optional bool UseFakeYfUpload = 4 [default = false]; // use in tests only to speedup upload - repeated string Artifacts = 5; /// default artifacts to put into every function + repeated string Artifacts = 5; /// default artifacts to put into every function repeated TRtmrOperationArtifactsInfo CommonArtifacts = 6; // common artifacts for all clusters optional uint32 MaxPqPartitions = 7 [default = 10]; optional uint32 PreviewCollectTimeoutMs = 8 [default = 2000]; diff --git a/ydb/library/yql/public/udf/udf_value.h b/ydb/library/yql/public/udf/udf_value.h index 5e917c47ae..705ac41133 100644 --- a/ydb/library/yql/public/udf/udf_value.h +++ b/ydb/library/yql/public/udf/udf_value.h @@ -764,7 +764,7 @@ private: TFlatDataBlock* AsFlatDataBlock() override; TSingleBlock* AsSingleBlock() override; EFetchStatus FetchBlock(TUnboxedValue& result, ui32 rowsLimitHint) override; - bool VisitBlocks(TBlockCallback callback, void* context) override; + bool VisitBlocks(TBlockCallback callback, void* context) override; #endif }; diff --git a/ydb/library/yql/udfs/common/clickhouse/client/ya.make b/ydb/library/yql/udfs/common/clickhouse/client/ya.make index 8673e9c947..d9ef0a6645 100644 --- a/ydb/library/yql/udfs/common/clickhouse/client/ya.make +++ b/ydb/library/yql/udfs/common/clickhouse/client/ya.make @@ -96,7 +96,7 @@ IF (OS_LINUX AND CLANG AND NOT WITH_VALGRIND) src/AggregateFunctions/AggregateFunctionFactory.cpp src/AggregateFunctions/AggregateFunctionCombinatorFactory.cpp - src/AggregateFunctions/IAggregateFunction.cpp + src/AggregateFunctions/IAggregateFunction.cpp src/Columns/Collator.cpp src/Columns/ColumnAggregateFunction.cpp |