Rewrite IPv4 Turf War backend

It can now handle 240k SQLite write QPS at 3ms 99 percentile latency.
We're still working out the kinks since it's brand new. But we've got
this running in production already!
This commit is contained in:
Justine Tunney 2022-10-03 08:17:37 -07:00
parent ccbae7799e
commit 91e167caaf
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
11 changed files with 1021 additions and 6 deletions

View file

@ -5766,6 +5766,7 @@ static const char *unixTempFileDir(void){
static int unixGetTempname(int nBuf, char *zBuf){
const char *zDir;
int iLimit = 0;
int e = errno; // [jart] don't pollute strace logs
/* It's odd to simulate an io-error here, but really this is just
** using the io-error infrastructure to test that SQLite handles this
@ -5785,6 +5786,7 @@ static int unixGetTempname(int nBuf, char *zBuf){
zDir, r, 0);
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR;
}while( osAccess(zBuf,0)==0 );
errno = e; // [jart] don't pollute strace logs
return SQLITE_OK;
}
@ -6317,8 +6319,10 @@ static int unixAccess(
if( flags==SQLITE_ACCESS_EXISTS ){
struct stat buf;
int e = errno; // [jart] don't clobber errno
*pResOut = 0==osStat(zPath, &buf) &&
(!S_ISREG(buf.st_mode) || buf.st_size>0);
errno = e; // [jart] don't clobber errno
}else{
*pResOut = osAccess(zPath, W_OK|R_OK)==0;
}