From eeb955fd5f9eb94b886c6b1896b712c04044d882 Mon Sep 17 00:00:00 2001 From: madmax330 Date: Mon, 28 Oct 2024 19:10:52 +0400 Subject: [PATCH 1/3] add log params for PR --- libstuff/SLog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libstuff/SLog.cpp b/libstuff/SLog.cpp index 2fd25615a..e33fbfe66 100644 --- a/libstuff/SLog.cpp +++ b/libstuff/SLog.cpp @@ -56,7 +56,9 @@ static const set PARAMS_WHITELIST = { "reportID", "token", "transactionID", - "type" + "type", + "bankAccountID", + "step" }; string addLogParams(string&& message, const map& params) { From 2cb81a8d10b56f7bc031cd2813ca6a4fcfd98b95 Mon Sep 17 00:00:00 2001 From: Nathalie Kuoch Date: Wed, 30 Oct 2024 10:10:33 +0100 Subject: [PATCH 2/3] whitelist more log params --- libstuff/SLog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libstuff/SLog.cpp b/libstuff/SLog.cpp index 2fd25615a..4d98b4db2 100644 --- a/libstuff/SLog.cpp +++ b/libstuff/SLog.cpp @@ -47,7 +47,10 @@ static const set PARAMS_WHITELIST = { "command", "companyName", "companyWebsite", + "domainAccountID", + "domainName", "errorMessage", + "feedCountry", "indexName", "invoice", "isUnique", @@ -70,7 +73,7 @@ string addLogParams(string&& message, const map& params) { string valueToLog = value; if (!SContains(PARAMS_WHITELIST, key)) { if (!GLOBAL_IS_LIVE) { - STHROW("500 Log param not in the whitelist, either do not log that or add it to PARAMS_WHITELIST if it's not sensitive"); + STHROW("500 Log param " + key + " not in the whitelist, either do not log that or add it to PARAMS_WHITELIST if it's not sensitive"); } valueToLog = ""; } From cec027be73b6a51417814808680a23f053f14c28 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Wed, 30 Oct 2024 16:06:28 -0400 Subject: [PATCH 3/3] Update SQLite with more logs, v7 --- libstuff/sqlite3.c | 43 ++++++++++++++++++++++++++++--------------- libstuff/sqlite3.h | 2 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/libstuff/sqlite3.c b/libstuff/sqlite3.c index 6463af945..3cf1aa995 100644 --- a/libstuff/sqlite3.c +++ b/libstuff/sqlite3.c @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** af4e778bd3bdf30cac3d9a6266f105a8cd71. +** 7dbb43bd307b5e297e6b2deac4e1d73d8cd6. */ #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 @@ -465,7 +465,7 @@ extern "C" { */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 -#define SQLITE_SOURCE_ID "2024-10-25 18:37:00 af4e778bd3bdf30cac3d9a6266f105a8cd71f947b8d71249ef74b8fdc0505dd7" +#define SQLITE_SOURCE_ID "2024-10-30 18:24:33 7dbb43bd307b5e297e6b2deac4e1d73d8cd68e37d880a5ecf5a3918a53e99d9d" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -17450,19 +17450,21 @@ SQLITE_PRIVATE int sqlite3CursorRangeHintExprCheck(Walker *pWalker, Expr *pExpr) #define COMMIT_TIME_RELOCATE2COUNT 9 #define COMMIT_TIME_AFTER_FIXUNLOCKED 10 -#define COMMIT_TIME_AFTER_WALFRAMES 11 -#define COMMIT_TIME_BEFORE_PHASETWO 12 -#define COMMIT_TIME_AFTER_PHASETWO 13 +#define COMMIT_TIME_OSWRITE 11 +#define COMMIT_TIME_AFTER_WALFRAMES 12 -#define COMMIT_TIME_AFTER_VDBECOMMIT 14 -#define COMMIT_TIME_AFTER_HALT 15 -#define COMMIT_TIME_FINISH 16 +#define COMMIT_TIME_BEFORE_PHASETWO 13 +#define COMMIT_TIME_AFTER_PHASETWO 14 -#define COMMIT_TIME_N 17 +#define COMMIT_TIME_AFTER_VDBECOMMIT 15 +#define COMMIT_TIME_AFTER_HALT 16 +#define COMMIT_TIME_FINISH 17 + +#define COMMIT_TIME_N 18 /* #define COMMIT_TIME_TIMEOUT (2*1000*1000) */ -#define COMMIT_TIME_TIMEOUT (10*1000) /* 10ms threshold */ +#define COMMIT_TIME_TIMEOUT (0*1000) /* 10ms threshold */ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64*); SQLITE_PRIVATE u64 sqlite3STimeNow(); @@ -70931,6 +70933,7 @@ static int walWriteToLog( sqlite3_int64 iOffset /* Start writing at this offset */ ){ int rc; + u64 t; if( iOffsetiSyncPoint && iOffset+iAmt>=p->iSyncPoint ){ int iFirstAmt = (int)(p->iSyncPoint - iOffset); rc = sqlite3OsWrite(p->pFd, pContent, iFirstAmt, iOffset); @@ -70942,7 +70945,13 @@ static int walWriteToLog( rc = sqlite3OsSync(p->pFd, WAL_SYNC_FLAGS(p->syncFlags)); if( iAmt==0 || rc ) return rc; } + if( p->pWal->aCommitTime ){ + t = sqlite3STimeNow(); + } rc = sqlite3OsWrite(p->pFd, pContent, iAmt, iOffset); + if( p->pWal->aCommitTime ){ + p->pWal->aCommitTime[COMMIT_TIME_OSWRITE] += (sqlite3STimeNow() - t); + } return rc; } @@ -93221,18 +93230,22 @@ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64 *aCommit){ for(ii=1; ii