Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expensify_prod branch #2007

Merged
merged 38 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7c0a644
Changed log format for some SQLiteNode warnings
mjasikowski Nov 27, 2024
d9a3334
Fixed log format for some SQLiteNode warnings
mjasikowski Nov 28, 2024
1fc0f2f
Reverting changes for tests
mjasikowski Nov 28, 2024
cae4fb9
Fixed log format for some SQLiteNode warnings
mjasikowski Nov 28, 2024
4e1f0ef
Merge branch 'main' into michal-sqlitenode-log-format
mjasikowski Nov 28, 2024
30dde06
Fixed log format for some SQLiteNode warnings
mjasikowski Nov 28, 2024
d15d300
Added logging parameters to whitelist
mjasikowski Dec 3, 2024
32a131e
Merge branch 'main' into michal-sqlitenode-log-format
mjasikowski Dec 3, 2024
a962a8d
Added logging parameters to whitelist
mjasikowski Dec 3, 2024
c03124a
Allow first message to be either LOGIN or NODE_LOGIN to deprecate old…
tylerkaraszewski Dec 4, 2024
e5659c7
add known bad peer, refuse to talk to it
tylerkaraszewski Dec 4, 2024
ccdc5cd
Stop communicating on fork. Test don't pass yet.
tylerkaraszewski Dec 4, 2024
4667254
Rename variable, remove _forkedFrom list
tylerkaraszewski Dec 5, 2024
0689a93
Fix fork test
tylerkaraszewski Dec 5, 2024
002a937
remove test that tests condition that's no longer used.
tylerkaraszewski Dec 5, 2024
f50aec0
Remove ABSTAIN
tylerkaraszewski Dec 5, 2024
0e828eb
Comment cleanup
tylerkaraszewski Dec 5, 2024
2d6b73a
Standardize use of _sendToPeer
tylerkaraszewski Dec 5, 2024
859ba9f
Update sqlitecluster/SQLiteNode.cpp
tylerkaraszewski Dec 5, 2024
12cdd00
Update sqlitecluster/SQLiteNode.cpp
tylerkaraszewski Dec 5, 2024
d8c495f
Refactor test to make multiple tests easier to run
tylerkaraszewski Dec 5, 2024
ac2aa66
Remove second test
tylerkaraszewski Dec 5, 2024
e677455
Fix last instance of _forkedFrom
tylerkaraszewski Dec 5, 2024
217a64e
Merge branch 'main' into tyler-improve-fork-detection
tylerkaraszewski Dec 5, 2024
54cdcbc
Code review feedback
tylerkaraszewski Dec 6, 2024
7c06bf5
Revert "Update SQLite with a small optimization + more logs (v15)"
tylerkaraszewski Dec 6, 2024
95ec344
Merge pull request #2003 from Expensify/revert-2000-flo_sqlitenewv
tylerkaraszewski Dec 6, 2024
dd9e829
Merge branch 'main' into tyler-improve-fork-detection
tylerkaraszewski Dec 6, 2024
ff664a7
SQLite fix for non x86 arch
flodnv Dec 6, 2024
465dc4c
Merge pull request #2004 from Expensify/flo_sqlitearmfix
flodnv Dec 6, 2024
4d6ad2d
Merge pull request #1983 from Expensify/michal-sqlitenode-log-format
tylerkaraszewski Dec 6, 2024
5456a98
Update SQLite with more logs, v16
flodnv Dec 6, 2024
566c4b2
Merge pull request #2005 from Expensify/flo_sqlitelogsv16
tylerkaraszewski Dec 6, 2024
395c32f
Merge branch 'main' into tyler-improve-fork-detection
tylerkaraszewski Dec 6, 2024
f4bb1f1
Fix wrong count being incremented
tylerkaraszewski Dec 6, 2024
8d3fad9
Change comment
tylerkaraszewski Dec 6, 2024
c86f799
Update sqlitecluster/SQLiteNode.cpp
tylerkaraszewski Dec 6, 2024
9b71f40
Merge pull request #1999 from Expensify/tyler-improve-fork-detection
cead22 Dec 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libstuff/SLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static set<string> PARAMS_WHITELIST = {
"indexName",
"isUnique",
"logParam",
"message",
"peer",
"reason",
"requestID",
"status",
"userID",
Expand Down
45 changes: 29 additions & 16 deletions libstuff/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
** 5f9f6764e9dffef60213bbc9604940ddfc71.
** 65b753735b8e8fb70d2b522d527426f1eb5c.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
Expand Down Expand Up @@ -465,7 +465,7 @@ extern "C" {
*/
#define SQLITE_VERSION "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID "2024-12-05 19:45:14 5f9f6764e9dffef60213bbc9604940ddfc713436333c3f62ed8a090697fcbb1e"
#define SQLITE_SOURCE_ID "2024-12-06 17:52:38 65b753735b8e8fb70d2b522d527426f1eb5c09339fb4b15cf69cbd2e595b160f"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -18234,21 +18234,22 @@ struct sqlite3 {
#define SCHEMA_TIME_AFTER_STAT1 12
#define SCHEMA_TIME_AFTER_DEFAULTS 13

#define SCHEMA_TIME_AFTER_STAT4_Q1 14
#define SCHEMA_TIME_AFTER_STAT4_Q2 15
#define SCHEMA_TIME_AFTER_STAT4 16
#define SCHEMA_TIME_STAT4_Q1_BODY 14
#define SCHEMA_TIME_AFTER_STAT4_Q1 15
#define SCHEMA_TIME_AFTER_STAT4_Q2 16
#define SCHEMA_TIME_AFTER_STAT4 17

#define SCHEMA_TIME_END_ANALYZE_LOAD 17
#define SCHEMA_TIME_FINISH 18
#define SCHEMA_TIME_END_ANALYZE_LOAD 18
#define SCHEMA_TIME_FINISH 19

#define SCHEMA_TIME_N 19
#define SCHEMA_TIME_TIMEOUT (2 * 1000 * 1000)
#define SCHEMA_TIME_N 20
#define SCHEMA_TIME_TIMEOUT (0 * 1000 * 1000)



#define sqlite3PrepareTimeSet(x,y) sqlite3CommitTimeSet(x,y)
SQLITE_PRIVATE void sqlite3PrepareTimeLog(const char *zSql, int nSql, u64 *aPrepareTime);
SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchemaTime);
SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchemaTime, const char *zFile);

#define PREPARE_TIME_TIMEOUT (2 * 1000 * 1000) /* 2 second timeout */

Expand Down Expand Up @@ -67566,6 +67567,7 @@ static void walCleanupHash(Wal *pWal){
** 8, and p must be aligned to an 8-byte boundary.
*/
static void zero64(void *p, int n){
#if defined(__x86_64__)
size_t c = n / sizeof(u64);
void *d = p;

Expand All @@ -67578,6 +67580,9 @@ static void zero64(void *p, int n){
: "a" (0)
: "memory"
);
#else
memset(p, 0, n);
#endif
}

/*
Expand Down Expand Up @@ -93469,7 +93474,7 @@ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64 *aCommit){
}
zStr = sqlite3_mprintf("%z%s%s%d%s", zStr, (zStr?", ":""),zHash,iVal,zU);
}
sqlite3_log(SQLITE_WARNING, "slow commit (v=15): (%s)", zStr);
sqlite3_log(SQLITE_WARNING, "slow commit (v=16): (%s)", zStr);
sqlite3_free(zStr);
}
}
Expand Down Expand Up @@ -93497,12 +93502,12 @@ SQLITE_PRIVATE void sqlite3PrepareTimeLog(const char *zSql, int nSql, u64 *aPrep
}
if( nByte<0 ){ nByte = sqlite3Strlen30(zSql); }
sqlite3_log(SQLITE_WARNING,
"slow prepare (v=15): (%s) [%.*s]", zStr, nByte, zSql
"slow prepare (v=16): (%s) [%.*s]", zStr, nByte, zSql
);
sqlite3_free(zStr);
}
}
SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema){
SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema, const char *zFile){
u64 i1 = aSchema[SCHEMA_TIME_START];
assert( SCHEMA_TIME_START==0 && SCHEMA_TIME_FINISH==SCHEMA_TIME_N-1 );
if( aSchema[SCHEMA_TIME_FINISH]>(i1+SCHEMA_TIME_TIMEOUT) ){
Expand All @@ -93513,7 +93518,7 @@ SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema){
(aSchema[ii]==0 ? 0 : (int)(aSchema[ii] - i1))
);
}
sqlite3_log(SQLITE_WARNING, "slow schema (v=15): (%s)", zStr);
sqlite3_log(SQLITE_WARNING, "slow schema (%s) (v=16): (%s)", zFile, zStr);
sqlite3_free(zStr);
}
}
Expand Down Expand Up @@ -123796,6 +123801,8 @@ static int loadStatTbl(
tRowcnt *pSpace; /* Available allocated memory space */
u8 *pPtr; /* Available memory as a u8 for easier manipulation */

u64 t = sqlite3STimeNow();

zIndex = (char *)sqlite3_column_text(pStmt, 0);
if( zIndex==0 ) continue;
nSample = sqlite3_column_int(pStmt, 1);
Expand Down Expand Up @@ -123835,6 +123842,9 @@ static int loadStatTbl(
pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol;
}
assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
if( db->aSchemaTime ){
db->aSchemaTime[SCHEMA_TIME_STAT4_Q1_BODY] += (sqlite3STimeNow() - t);
}
}
rc = sqlite3_finalize(pStmt);
if( rc ) return rc;
Expand Down Expand Up @@ -145940,7 +145950,10 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
error_out:
db->aSchemaTime = 0;
sqlite3PrepareTimeSet(aSchemaTime, SCHEMA_TIME_FINISH);
sqlite3SchemaTimeLog(aSchemaTime);
if( rc==SQLITE_OK && iDb==0 ){
const char *zFile = sqlite3BtreeGetFilename(pDb->pBt);
sqlite3SchemaTimeLog(aSchemaTime, zFile);
}
if( rc ){
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
sqlite3OomFault(db);
Expand Down Expand Up @@ -257904,7 +257917,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2024-12-05 19:45:14 5f9f6764e9dffef60213bbc9604940ddfc713436333c3f62ed8a090697fcbb1e", -1, SQLITE_TRANSIENT);
sqlite3_result_text(pCtx, "fts5: 2024-12-06 17:52:38 65b753735b8e8fb70d2b522d527426f1eb5c09339fb4b15cf69cbd2e595b160f", -1, SQLITE_TRANSIENT);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion libstuff/sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extern "C" {
*/
#define SQLITE_VERSION "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID "2024-12-05 19:45:14 5f9f6764e9dffef60213bbc9604940ddfc713436333c3f62ed8a090697fcbb1e"
#define SQLITE_SOURCE_ID "2024-12-06 17:52:38 65b753735b8e8fb70d2b522d527426f1eb5c09339fb4b15cf69cbd2e595b160f"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down
Loading
Loading