diff options
| author | Semyon Danilov <[email protected]> | 2025-10-20 14:47:44 +0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-20 14:47:44 +0400 |
| commit | 8d151163628ad8edc3bfedb067b6f8ec0fb277d0 (patch) | |
| tree | b7921c1a6ab5ae31475a9cd97ff10d993e1a40d1 | |
| parent | 6f2768b8d563b9facb737ab26371c5a0b9989d81 (diff) | |
Add BSC commands audit logging (#27079)
| -rw-r--r-- | ydb/core/mind/bscontroller/config_cmd.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ydb/core/mind/bscontroller/config_cmd.cpp b/ydb/core/mind/bscontroller/config_cmd.cpp index 3fa20538d5e..6624114b230 100644 --- a/ydb/core/mind/bscontroller/config_cmd.cpp +++ b/ydb/core/mind/bscontroller/config_cmd.cpp @@ -312,18 +312,22 @@ namespace NKikimr::NBsController { } void LogCommand(TTransactionContext& txc, TDuration executionTime) { + ui64 operationLogIndex = Self->NextOperationLogIndex; // update operation log for write transaction NIceDb::TNiceDb db(txc.DB); TString requestBuffer, responseBuffer; Y_PROTOBUF_SUPPRESS_NODISCARD Cmd.SerializeToString(&requestBuffer); Y_PROTOBUF_SUPPRESS_NODISCARD Response->SerializeToString(&responseBuffer); - db.Table<Schema::OperationLog>().Key(Self->NextOperationLogIndex).Update( + db.Table<Schema::OperationLog>().Key(operationLogIndex).Update( NIceDb::TUpdate<Schema::OperationLog::Timestamp>(TActivationContext::Now()), NIceDb::TUpdate<Schema::OperationLog::Request>(requestBuffer), NIceDb::TUpdate<Schema::OperationLog::Response>(responseBuffer), NIceDb::TUpdate<Schema::OperationLog::ExecutionTime>(executionTime)); db.Table<Schema::State>().Key(true).Update( NIceDb::TUpdate<Schema::State::NextOperationLogIndex>(++Self->NextOperationLogIndex)); + + STLOG(PRI_INFO, BS_CONTROLLER_AUDIT, BSCA10, "Finished processing command", (Request, Cmd.DebugString()), + (Response, Response->DebugString()), (ExecutionTime, executionTime), (OperationLogIndex, operationLogIndex)); } void ExecuteStep(TConfigState& state, const NKikimrBlobStorage::TConfigRequest::TCommand& cmd, |
