Skip to content

Commit a632243

Browse files
committed
Merge tag '24.3.14' into stream-nb-24-3-merge-24.3.14
2 parents 986e97a + 254d1a5 commit a632243

File tree

1,133 files changed

+46502
-27223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,133 files changed

+46502
-27223
lines changed

.github/actions/s3cmd/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runs:
5353
debug)
5454
folder+="-debug"
5555
;;
56-
release-*)
56+
release*)
5757
folder+="-${BUILD_PRESET/release-/}"
5858
;;
5959
*)

.github/actions/test_ya/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ runs:
103103
debug)
104104
TESTMO_SOURCE="ya-${ARCH}-debug"
105105
;;
106-
release-*)
106+
release*)
107107
TESTMO_SOURCE="ya-${ARCH}-${BUILD_PRESET/release-/}"
108108
;;
109109
*)
@@ -180,6 +180,9 @@ runs:
180180
relwithdebinfo)
181181
params+=(--build "relwithdebinfo")
182182
;;
183+
release)
184+
params+=(--build "release")
185+
;;
183186
release-asan)
184187
params+=(
185188
--build "release" --sanitize="address"

.github/config/muted_ya.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ydb/core/external_sources *
88
ydb/core/quoter/ut QuoterWithKesusTest.PrefetchCoefficient
99
ydb/core/keyvalue/ut_trace TKeyValueTracingTest.*
1010
ydb/core/kqp/provider/ut KikimrIcGateway.TestLoadBasicSecretValueFromExternalDataSourceMetadata
11+
ydb/core/kqp/ut/join KqpJoinOrder.Chain65Nodes
1112
ydb/core/kqp/ut/olap KqpOlapBlobsSharing.*
1213
ydb/core/kqp/ut/olap KqpOlapStatistics.StatsUsageWithTTL
1314
ydb/core/kqp/ut/pg KqpPg.CreateIndex
@@ -17,6 +18,7 @@ ydb/core/kqp/ut/tx KqpSnapshotRead.ReadOnlyTxWithIndexCommitsOnConcurrentWrite+w
1718
ydb/core/kqp/ut/tx KqpSinkTx.InvalidateOnError
1819
ydb/core/kqp/ut/query KqpLimits.QueryReplySize
1920
ydb/core/kqp/ut/query KqpQuery.QueryTimeout
21+
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
2022
ydb/core/kqp/ut/scan KqpRequestContext.TraceIdInErrorMessage
2123
ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
2224
ydb/core/kqp/ut/scheme KqpScheme.AlterAsyncReplication
@@ -26,9 +28,9 @@ ydb/core/kqp/ut/scheme [15/50]*
2628
ydb/core/kqp/ut/scheme [44/50]*
2729
ydb/core/kqp/ut/service KqpQueryService.ExecuteQueryPgTableSelect
2830
ydb/core/kqp/ut/service KqpQueryService.QueryOnClosedSession
31+
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
2932
ydb/core/kqp/ut/service KqpService.CloseSessionsWithLoad
3033
ydb/core/kqp/ut/service [38/50]*
31-
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
3234
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
3335
ydb/core/persqueue/ut [37/40] chunk chunk
3436
ydb/core/persqueue/ut [38/40] chunk chunk

.github/workflows/nightly_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
build_preset: ["relwithdebinfo", "release-asan"]
17+
build_preset: ["release", "relwithdebinfo", "release-asan"]
1818
runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', matrix.build_preset) }}" ]
1919
name: Build and test ${{ matrix.build_preset }}
2020
steps:

.github/workflows/pr_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ jobs:
203203
strategy:
204204
fail-fast: false
205205
matrix:
206-
build_preset: ["relwithdebinfo", "release-asan", "release-clang14"]
206+
build_preset: ["relwithdebinfo", "release-asan"]
207207
runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', matrix.build_preset) }}" ]
208208
name: Build and test ${{ matrix.build_preset }}
209209
steps:
@@ -247,7 +247,7 @@ jobs:
247247
https://api.github.com/repos/${{github.repository}}/commits/${{github.event.pull_request.head.sha}}/status | \
248248
jq -cr '.statuses | .[] | select(.state=="success") | select(.context | startswith("build_")) | .context' | \
249249
wc -l )
250-
if [[ $successbuilds == "3" ]];then
250+
if [[ $successbuilds == "2" ]];then
251251
integrated_status="success"
252252
else
253253
integrated_status="failure"

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
!*/
88
# Unignore all files inside canondata dir
99
!**/canondata/**
10+
# Allow docker files
11+
!Dockerfile
1012

1113
/canonization_show_res.log
1214

@@ -26,6 +28,9 @@ __pycache__/
2628
*.pb.h
2729
*.pb.cc
2830

31+
# Other generated
32+
*.fbs.h
33+
2934
# MacOS specific
3035
.DS_Store
3136

@@ -40,6 +45,7 @@ __pycache__/
4045
.idea/
4146
.vscode/
4247
.clangd
48+
.antlr/
4349

4450
# KDevelop IDE
4551
*.kdev4
@@ -79,3 +85,6 @@ list_result.log
7985
bin/config.json
8086

8187
.vs/
88+
89+
# handy for local junk, which is not intended to appear in the repo
90+
junk/

library/cpp/threading/future/core/future-inl.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ namespace NThreading {
116116
bool HasException() const {
117117
return AtomicGet(State) == ExceptionSet;
118118
}
119+
bool IsReady() const {
120+
return AtomicGet(State) != NotReady;
121+
}
119122

120123
const T& GetValue(TDuration timeout = TDuration::Zero()) const {
121124
AccessValue(timeout, ValueRead);
@@ -297,6 +300,9 @@ namespace NThreading {
297300
bool HasException() const {
298301
return AtomicGet(State) == ExceptionSet;
299302
}
303+
bool IsReady() const {
304+
return AtomicGet(State) != NotReady;
305+
}
300306

301307
void GetValue(TDuration timeout = TDuration::Zero()) const {
302308
TAtomicBase state = AtomicGet(State);
@@ -583,6 +589,10 @@ namespace NThreading {
583589
inline bool TFuture<T>::HasException() const {
584590
return State && State->HasException();
585591
}
592+
template <typename T>
593+
inline bool TFuture<T>::IsReady() const {
594+
return State && State->IsReady();
595+
}
586596

587597
template <typename T>
588598
inline void TFuture<T>::Wait() const {
@@ -688,6 +698,9 @@ namespace NThreading {
688698
inline bool TFuture<void>::HasException() const {
689699
return State && State->HasException();
690700
}
701+
inline bool TFuture<void>::IsReady() const {
702+
return State && State->IsReady();
703+
}
691704

692705
inline void TFuture<void>::Wait() const {
693706
EnsureInitialized();
@@ -823,6 +836,11 @@ namespace NThreading {
823836
return State && State->HasException();
824837
}
825838

839+
template <typename T>
840+
inline bool TPromise<T>::IsReady() const {
841+
return State && State->IsReady();
842+
}
843+
826844
template <typename T>
827845
inline void TPromise<T>::SetException(const TString& e) {
828846
EnsureInitialized();
@@ -904,6 +922,10 @@ namespace NThreading {
904922
return State && State->HasException();
905923
}
906924

925+
inline bool TPromise<void>::IsReady() const {
926+
return State && State->IsReady();
927+
}
928+
907929
inline void TPromise<void>::SetException(const TString& e) {
908930
EnsureInitialized();
909931
State->SetException(std::make_exception_ptr(yexception() << e));

library/cpp/threading/future/core/future.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ namespace NThreading {
9898
void TryRethrow() const;
9999
bool HasException() const;
100100

101+
// returns true if exception or value was set.
102+
// allows to check readiness without locking cheker-thread
103+
// NOTE: returns true even if value was extracted from promise
104+
// good replace for HasValue() || HasException()
105+
bool IsReady() const;
106+
101107
void Wait() const;
102108
bool Wait(TDuration timeout) const;
103109
bool Wait(TInstant deadline) const;
@@ -153,6 +159,11 @@ namespace NThreading {
153159
void TryRethrow() const;
154160
bool HasException() const;
155161

162+
// returns true if exception or value was set.
163+
// allows to check readiness without locking cheker-thread
164+
// good replace for HasValue() || HasException()
165+
bool IsReady() const;
166+
156167
void Wait() const;
157168
bool Wait(TDuration timeout) const;
158169
bool Wait(TInstant deadline) const;
@@ -216,6 +227,12 @@ namespace NThreading {
216227

217228
void TryRethrow() const;
218229
bool HasException() const;
230+
231+
// returns true if exception or value was set.
232+
// allows to check readiness without locking cheker-thread
233+
// NOTE: returns true even if value was extracted from promise
234+
// good replace for HasValue() || HasException()
235+
bool IsReady() const;
219236
void SetException(const TString& e);
220237
void SetException(std::exception_ptr e);
221238
bool TrySetException(std::exception_ptr e);
@@ -256,6 +273,11 @@ namespace NThreading {
256273

257274
void TryRethrow() const;
258275
bool HasException() const;
276+
277+
// returns true if exception or value was set.
278+
// allows to check readiness without locking cheker-thread
279+
// good replace for HasValue() || HasException()
280+
bool IsReady() const;
259281
void SetException(const TString& e);
260282
void SetException(std::exception_ptr e);
261283
bool TrySetException(std::exception_ptr e);

library/cpp/threading/future/future_ut.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ namespace {
105105

106106
future = MakeFuture(345);
107107
UNIT_ASSERT(future.HasValue());
108+
UNIT_ASSERT(future.IsReady());
108109
UNIT_ASSERT_EQUAL(future.GetValue(), 345);
109110
}
110111

@@ -115,6 +116,7 @@ namespace {
115116

116117
TFuture<void> future = promise.GetFuture();
117118
UNIT_ASSERT(future.HasValue());
119+
UNIT_ASSERT(future.IsReady());
118120

119121
future = MakeFuture();
120122
UNIT_ASSERT(future.HasValue());
@@ -523,6 +525,7 @@ namespace {
523525
{
524526
auto future1 = MakeErrorFuture<void>(std::make_exception_ptr(TFutureException()));
525527
UNIT_ASSERT(future1.HasException());
528+
UNIT_ASSERT(future1.IsReady());
526529
UNIT_CHECK_GENERATED_EXCEPTION(future1.GetValue(), TFutureException);
527530

528531
auto future2 = MakeErrorFuture<int>(std::make_exception_ptr(TFutureException()));
@@ -563,6 +566,7 @@ namespace {
563566
promise2.SetException("foo-exception");
564567
wait.Wait();
565568
UNIT_ASSERT(future2.HasException());
569+
UNIT_ASSERT(!future1.IsReady());
566570
UNIT_ASSERT(!future1.HasValue() && !future1.HasException());
567571
}
568572

ydb/core/audit/audit_log_impl.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void WriteLog(const TString& log, const TVector<THolder<TLogBackend>>& logBacken
7373
log.length()
7474
));
7575
} catch (const yexception& e) {
76-
LOG_W("WriteLog: unable to write audit log (error: " << e.what() << ")");
76+
LOG_E("WriteLog: unable to write audit log (error: " << e.what() << ")");
7777
}
7878
}
7979
}
@@ -91,6 +91,27 @@ TString GetJsonLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
9191
return ss.Str();
9292
}
9393

94+
TString GetJsonLogCompatibleLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
95+
const auto* msg = ev->Get();
96+
TStringStream ss;
97+
NJsonWriter::TBuf json(NJsonWriter::HEM_DONT_ESCAPE_HTML, &ss);
98+
{
99+
auto obj = json.BeginObject();
100+
obj
101+
.WriteKey("@timestamp")
102+
.WriteString(msg->Time.ToString().data())
103+
.WriteKey("@log_type")
104+
.WriteString("audit");
105+
106+
for (auto& [k, v] : msg->Parts) {
107+
obj.WriteKey(k).WriteString(v);
108+
}
109+
json.EndObject();
110+
}
111+
ss << Endl;
112+
return ss.Str();
113+
}
114+
94115
TString GetTxtLog(const TEvAuditLog::TEvWriteAuditLog::TPtr& ev) {
95116
const auto* msg = ev->Get();
96117
TStringStream ss;
@@ -146,6 +167,9 @@ class TAuditLogActor final : public TActor<TAuditLogActor> {
146167
case NKikimrConfig::TAuditConfig::TXT:
147168
WriteLog(GetTxtLog(ev), logBackends.second);
148169
break;
170+
case NKikimrConfig::TAuditConfig::JSON_LOG_COMPATIBLE:
171+
WriteLog(GetJsonLogCompatibleLog(ev), logBackends.second);
172+
break;
149173
default:
150174
WriteLog(GetJsonLog(ev), logBackends.second);
151175
break;

0 commit comments

Comments
 (0)