Skip to content

Commit

Permalink
Merge tag '24.3.14' into stream-nb-24-3-merge-24.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherednik committed Dec 10, 2024
2 parents 986e97a + 254d1a5 commit c1b8bd1
Show file tree
Hide file tree
Showing 1,132 changed files with 46,481 additions and 27,232 deletions.
2 changes: 1 addition & 1 deletion .github/actions/s3cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
debug)
folder+="-debug"
;;
release-*)
release*)
folder+="-${BUILD_PRESET/release-/}"
;;
*)
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/test_ya/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ runs:
debug)
TESTMO_SOURCE="ya-${ARCH}-debug"
;;
release-*)
release*)
TESTMO_SOURCE="ya-${ARCH}-${BUILD_PRESET/release-/}"
;;
*)
Expand Down Expand Up @@ -180,6 +180,9 @@ runs:
relwithdebinfo)
params+=(--build "relwithdebinfo")
;;
release)
params+=(--build "release")
;;
release-asan)
params+=(
--build "release" --sanitize="address"
Expand Down
4 changes: 3 additions & 1 deletion .github/config/muted_ya.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ydb/core/external_sources *
ydb/core/quoter/ut QuoterWithKesusTest.PrefetchCoefficient
ydb/core/keyvalue/ut_trace TKeyValueTracingTest.*
ydb/core/kqp/provider/ut KikimrIcGateway.TestLoadBasicSecretValueFromExternalDataSourceMetadata
ydb/core/kqp/ut/join KqpJoinOrder.Chain65Nodes
ydb/core/kqp/ut/olap KqpOlapBlobsSharing.*
ydb/core/kqp/ut/olap KqpOlapStatistics.StatsUsageWithTTL
ydb/core/kqp/ut/pg KqpPg.CreateIndex
Expand All @@ -17,6 +18,7 @@ ydb/core/kqp/ut/tx KqpSnapshotRead.ReadOnlyTxWithIndexCommitsOnConcurrentWrite+w
ydb/core/kqp/ut/tx KqpSinkTx.InvalidateOnError
ydb/core/kqp/ut/query KqpLimits.QueryReplySize
ydb/core/kqp/ut/query KqpQuery.QueryTimeout
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
ydb/core/kqp/ut/scan KqpRequestContext.TraceIdInErrorMessage
ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
ydb/core/kqp/ut/scheme KqpScheme.AlterAsyncReplication
Expand All @@ -26,9 +28,9 @@ ydb/core/kqp/ut/scheme [15/50]*
ydb/core/kqp/ut/scheme [44/50]*
ydb/core/kqp/ut/service KqpQueryService.ExecuteQueryPgTableSelect
ydb/core/kqp/ut/service KqpQueryService.QueryOnClosedSession
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
ydb/core/kqp/ut/service KqpService.CloseSessionsWithLoad
ydb/core/kqp/ut/service [38/50]*
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
ydb/core/persqueue/ut [37/40] chunk chunk
ydb/core/persqueue/ut [38/40] chunk chunk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build_preset: ["relwithdebinfo", "release-asan"]
build_preset: ["release", "relwithdebinfo", "release-asan"]
runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', matrix.build_preset) }}" ]
name: Build and test ${{ matrix.build_preset }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build_preset: ["relwithdebinfo", "release-asan", "release-clang14"]
build_preset: ["relwithdebinfo", "release-asan"]
runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', matrix.build_preset) }}" ]
name: Build and test ${{ matrix.build_preset }}
steps:
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
https://api.github.com/repos/${{github.repository}}/commits/${{github.event.pull_request.head.sha}}/status | \
jq -cr '.statuses | .[] | select(.state=="success") | select(.context | startswith("build_")) | .context' | \
wc -l )
if [[ $successbuilds == "3" ]];then
if [[ $successbuilds == "2" ]];then
integrated_status="success"
else
integrated_status="failure"
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
!*/
# Unignore all files inside canondata dir
!**/canondata/**
# Allow docker files
!Dockerfile

/canonization_show_res.log

Expand All @@ -26,6 +28,9 @@ __pycache__/
*.pb.h
*.pb.cc

# Other generated
*.fbs.h

# MacOS specific
.DS_Store

Expand All @@ -40,6 +45,7 @@ __pycache__/
.idea/
.vscode/
.clangd
.antlr/

# KDevelop IDE
*.kdev4
Expand Down Expand Up @@ -79,3 +85,6 @@ list_result.log
bin/config.json

.vs/

# handy for local junk, which is not intended to appear in the repo
junk/
22 changes: 22 additions & 0 deletions library/cpp/threading/future/core/future-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ namespace NThreading {
bool HasException() const {
return AtomicGet(State) == ExceptionSet;
}
bool IsReady() const {
return AtomicGet(State) != NotReady;
}

const T& GetValue(TDuration timeout = TDuration::Zero()) const {
AccessValue(timeout, ValueRead);
Expand Down Expand Up @@ -297,6 +300,9 @@ namespace NThreading {
bool HasException() const {
return AtomicGet(State) == ExceptionSet;
}
bool IsReady() const {
return AtomicGet(State) != NotReady;
}

void GetValue(TDuration timeout = TDuration::Zero()) const {
TAtomicBase state = AtomicGet(State);
Expand Down Expand Up @@ -583,6 +589,10 @@ namespace NThreading {
inline bool TFuture<T>::HasException() const {
return State && State->HasException();
}
template <typename T>
inline bool TFuture<T>::IsReady() const {
return State && State->IsReady();
}

template <typename T>
inline void TFuture<T>::Wait() const {
Expand Down Expand Up @@ -688,6 +698,9 @@ namespace NThreading {
inline bool TFuture<void>::HasException() const {
return State && State->HasException();
}
inline bool TFuture<void>::IsReady() const {
return State && State->IsReady();
}

inline void TFuture<void>::Wait() const {
EnsureInitialized();
Expand Down Expand Up @@ -823,6 +836,11 @@ namespace NThreading {
return State && State->HasException();
}

template <typename T>
inline bool TPromise<T>::IsReady() const {
return State && State->IsReady();
}

template <typename T>
inline void TPromise<T>::SetException(const TString& e) {
EnsureInitialized();
Expand Down Expand Up @@ -904,6 +922,10 @@ namespace NThreading {
return State && State->HasException();
}

inline bool TPromise<void>::IsReady() const {
return State && State->IsReady();
}

inline void TPromise<void>::SetException(const TString& e) {
EnsureInitialized();
State->SetException(std::make_exception_ptr(yexception() << e));
Expand Down
22 changes: 22 additions & 0 deletions library/cpp/threading/future/core/future.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ namespace NThreading {
void TryRethrow() const;
bool HasException() const;

// returns true if exception or value was set.
// allows to check readiness without locking cheker-thread
// NOTE: returns true even if value was extracted from promise
// good replace for HasValue() || HasException()
bool IsReady() const;

void Wait() const;
bool Wait(TDuration timeout) const;
bool Wait(TInstant deadline) const;
Expand Down Expand Up @@ -153,6 +159,11 @@ namespace NThreading {
void TryRethrow() const;
bool HasException() const;

// returns true if exception or value was set.
// allows to check readiness without locking cheker-thread
// good replace for HasValue() || HasException()
bool IsReady() const;

void Wait() const;
bool Wait(TDuration timeout) const;
bool Wait(TInstant deadline) const;
Expand Down Expand Up @@ -216,6 +227,12 @@ namespace NThreading {

void TryRethrow() const;
bool HasException() const;

// returns true if exception or value was set.
// allows to check readiness without locking cheker-thread
// NOTE: returns true even if value was extracted from promise
// good replace for HasValue() || HasException()
bool IsReady() const;
void SetException(const TString& e);
void SetException(std::exception_ptr e);
bool TrySetException(std::exception_ptr e);
Expand Down Expand Up @@ -256,6 +273,11 @@ namespace NThreading {

void TryRethrow() const;
bool HasException() const;

// returns true if exception or value was set.
// allows to check readiness without locking cheker-thread
// good replace for HasValue() || HasException()
bool IsReady() const;
void SetException(const TString& e);
void SetException(std::exception_ptr e);
bool TrySetException(std::exception_ptr e);
Expand Down
4 changes: 4 additions & 0 deletions library/cpp/threading/future/future_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ namespace {

future = MakeFuture(345);
UNIT_ASSERT(future.HasValue());
UNIT_ASSERT(future.IsReady());
UNIT_ASSERT_EQUAL(future.GetValue(), 345);
}

Expand All @@ -115,6 +116,7 @@ namespace {

TFuture<void> future = promise.GetFuture();
UNIT_ASSERT(future.HasValue());
UNIT_ASSERT(future.IsReady());

future = MakeFuture();
UNIT_ASSERT(future.HasValue());
Expand Down Expand Up @@ -523,6 +525,7 @@ namespace {
{
auto future1 = MakeErrorFuture<void>(std::make_exception_ptr(TFutureException()));
UNIT_ASSERT(future1.HasException());
UNIT_ASSERT(future1.IsReady());
UNIT_CHECK_GENERATED_EXCEPTION(future1.GetValue(), TFutureException);

auto future2 = MakeErrorFuture<int>(std::make_exception_ptr(TFutureException()));
Expand Down Expand Up @@ -563,6 +566,7 @@ namespace {
promise2.SetException("foo-exception");
wait.Wait();
UNIT_ASSERT(future2.HasException());
UNIT_ASSERT(!future1.IsReady());
UNIT_ASSERT(!future1.HasValue() && !future1.HasException());
}

Expand Down
26 changes: 25 additions & 1 deletion ydb/core/audit/audit_log_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void WriteLog(const TString& log, const TVector<THolder<TLogBackend>>& logBacken
log.length()
));
} catch (const yexception& e) {
LOG_W("WriteLog: unable to write audit log (error: " << e.what() << ")");
LOG_E("WriteLog: unable to write audit log (error: " << e.what() << ")");
}
}
}
Expand All @@ -91,6 +91,27 @@ TString GetJsonLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
return ss.Str();
}

TString GetJsonLogCompatibleLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
const auto* msg = ev->Get();
TStringStream ss;
NJsonWriter::TBuf json(NJsonWriter::HEM_DONT_ESCAPE_HTML, &ss);
{
auto obj = json.BeginObject();
obj
.WriteKey("@timestamp")
.WriteString(msg->Time.ToString().data())
.WriteKey("@log_type")
.WriteString("audit");

for (auto& [k, v] : msg->Parts) {
obj.WriteKey(k).WriteString(v);
}
json.EndObject();
}
ss << Endl;
return ss.Str();
}

TString GetTxtLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
const auto* msg = ev->Get();
TStringStream ss;
Expand Down Expand Up @@ -146,6 +167,9 @@ class TAuditLogActor final : public TActor<TAuditLogActor> {
case NKikimrConfig::TAuditConfig::TXT:
WriteLog(GetTxtLog(ev), logBackends.second);
break;
case NKikimrConfig::TAuditConfig::JSON_LOG_COMPATIBLE:
WriteLog(GetJsonLogCompatibleLog(ev), logBackends.second);
break;
default:
WriteLog(GetJsonLog(ev), logBackends.second);
break;
Expand Down
4 changes: 0 additions & 4 deletions ydb/core/audit/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@ PEERDIR(
ydb/core/base
)

RESOURCE(
ydb/core/kqp/kqp_default_settings.txt kqp_default_settings.txt
)

END()
5 changes: 5 additions & 0 deletions ydb/core/base/blobstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ struct TEvBlobStorage {
EvInplacePatch,
EvAssimilate,

EvGetQueuesInfo, // for debugging purposes

//
EvPutResult = EvPut + 512, /// 268 632 576
EvGetResult,
Expand All @@ -502,6 +504,8 @@ struct TEvBlobStorage {
EvInplacePatchResult,
EvAssimilateResult,

EvQueuesInfo, // for debugging purposes

// proxy <-> vdisk interface
EvVPut = EvPut + 2 * 512, /// 268 633 088
EvVGet,
Expand Down Expand Up @@ -871,6 +875,7 @@ struct TEvBlobStorage {
EvRunActor = EvPut + 15 * 512,
EvVMockCtlRequest,
EvVMockCtlResponse,
EvDelayedMessageWrapper,

// incremental huge blob keeper
EvIncrHugeInit = EvPut + 17 * 512,
Expand Down
12 changes: 11 additions & 1 deletion ydb/core/base/ticket_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,24 @@ namespace NKikimr {

struct TError {
TString Message;
TString LogMessage;
bool Retryable = true;

bool empty() const {
return Message.empty();
return Message.empty() && LogMessage.empty();
}

bool HasMessage() const {
return !Message.empty();
}

bool HasLogMessage() const {
return !LogMessage.empty();
}

void clear() {
Message.clear();
LogMessage.clear();
Retryable = true;
}

Expand Down
Loading

0 comments on commit c1b8bd1

Please sign in to comment.