Fix a problem in lsmtest causing one test to fail for multi-threaded LSM

connections.

FossilOrigin-Name: 2bce64c8864b616f9ab0063f64d0ceb2f83e53e110970c6b3b11003cba5c8804
This commit is contained in:
dan
2017-07-05 14:29:04 +00:00
parent 269ba80469
commit 7181395a4d
5 changed files with 30 additions and 11 deletions
+6 -1
View File
@@ -44,6 +44,7 @@ static void doDataTest4(
int i;
int rc = 0;
int iDot = 0;
int bMultiThreaded = 0; /* True for MT LSM database */
int nRecOn3 = (p->nRec / 3);
int iData = 0;
@@ -52,7 +53,10 @@ static void doDataTest4(
rc = testControlDb(&pControl);
pDb = testOpen(zSystem, 1, &rc);
pData = testDatasourceNew(&p->defn);
if( rc==0 ) db = tdb_lsm(pDb);
if( rc==0 ){
db = tdb_lsm(pDb);
bMultiThreaded = tdb_lsm_multithread(pDb);
}
testWriteDatasourceRange(pControl, pData, iData, nRecOn3*3, &rc);
testWriteDatasourceRange(pDb, pData, iData, nRecOn3*3, &rc);
@@ -71,6 +75,7 @@ static void doDataTest4(
nDone = 0;
rc = lsm_work(db, 1, (1<<30), &nDone);
}while( rc==0 && nDone>0 );
if( bMultiThreaded && rc==LSM_BUSY ) rc = LSM_OK;
#if 0
fprintf(stderr, "lsm_work() done...\n"); fflush(stderr);
#endif
+6
View File
@@ -136,6 +136,12 @@ int tdb_lsm_open(const char *zCfg, const char *zDb, int bClear, TestDb **ppDb);
*/
lsm_db *tdb_lsm(TestDb *pDb);
/*
** Return true if the db passed as an argument is a multi-threaded LSM
** connection.
*/
int tdb_lsm_multithread(TestDb *pDb);
/*
** Return a pointer to the lsm_env object used by all lsm database
** connections initialized as a copy of the object returned by
+8
View File
@@ -1051,6 +1051,14 @@ lsm_db *tdb_lsm(TestDb *pDb){
return 0;
}
int tdb_lsm_multithread(TestDb *pDb){
int ret = 0;
if( tdb_lsm(pDb) ){
ret = ((LsmDb*)pDb)->eMode!=LSMTEST_MODE_SINGLETHREAD;
}
return ret;
}
void tdb_lsm_enable_log(TestDb *pDb, int bEnable){
lsm_db *db = tdb_lsm(pDb);
if( db ){