Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Allow freelist-only age=1 segments to be written even if there are already NMERGE age=1 segments.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 88205b2bc6e7579899c2c840716f993747286be5
User & Date: dan 2012-11-29 18:25:34.381
Context
2012-11-29
19:14
Avoid reading and checksumming an entire meta-page every time a write transaction is opened. check-in: d4c5a3bad7 user: dan tags: trunk
18:25
Allow freelist-only age=1 segments to be written even if there are already NMERGE age=1 segments. check-in: 88205b2bc6 user: dan tags: trunk
09:48
In mmap-mode, ensure a checkpointer has the entire database file mapped before calling msync(). check-in: a9f8129cce user: dan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to lsm-test/lsmtest_tdb3.c.
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
  int nSleep = 0;

  rc = lsm_config(pDb->db, LSM_CONFIG_AUTOFLUSH, &nLimit);
  do {
    int bOld, nNew, rc;
    rc = lsm_info(pDb->db, LSM_INFO_TREE_SIZE, &bOld, &nNew);
    if( rc!=LSM_OK ) return rc;
    if( bOld==0 || nNew<nLimit ) break;
    usleep(5000);
    nSleep += 5;
  }while( 1 );

#if 0
  if( nSleep ) printf("# waitOnWorker(): nSleep=%d\n", nSleep);
#endif







|







524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
  int nSleep = 0;

  rc = lsm_config(pDb->db, LSM_CONFIG_AUTOFLUSH, &nLimit);
  do {
    int bOld, nNew, rc;
    rc = lsm_info(pDb->db, LSM_INFO_TREE_SIZE, &bOld, &nNew);
    if( rc!=LSM_OK ) return rc;
    if( bOld==0 || nNew<(nLimit/2) ) break;
    usleep(5000);
    nSleep += 5;
  }while( 1 );

#if 0
  if( nSleep ) printf("# waitOnWorker(): nSleep=%d\n", nSleep);
#endif
Changes to src/lsm_sorted.c.
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
    if( nPg ) bDirty = 1;
  }

  /* If the in-memory part of the free-list is too large, write a new 
  ** top-level containing just the in-memory free-list entries to disk. */
  if( rc==LSM_OK && pDb->pWorker->freelist.nEntry > pDb->nMaxFreelist ){
    int nPg = 0;
    while( rc==LSM_OK && sortedDbIsFull(pDb) ){
      rc = sortedWork(pDb, 16, nMerge, 1, &nPg);
      nRem -= nPg;
    }
    if( rc==LSM_OK ){
      rc = sortedNewToplevel(pDb, TREE_NONE, &nPg);
    }
    nRem -= nPg;







|







4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
    if( nPg ) bDirty = 1;
  }

  /* If the in-memory part of the free-list is too large, write a new 
  ** top-level containing just the in-memory free-list entries to disk. */
  if( rc==LSM_OK && pDb->pWorker->freelist.nEntry > pDb->nMaxFreelist ){
    int nPg = 0;
    while( rc==LSM_OK && lsmDatabaseFull(pDb) ){
      rc = sortedWork(pDb, 16, nMerge, 1, &nPg);
      nRem -= nPg;
    }
    if( rc==LSM_OK ){
      rc = sortedNewToplevel(pDb, TREE_NONE, &nPg);
    }
    nRem -= nPg;
Changes to www/index.wiki.
1
2
3
4
5
6
7
8
9
10

<title>SQLite4</title>

  *  [./design.wiki | The Design Of SQLite4]
  *  [./env.wiki | The Run-time Environment Object]
  *  [./varint.wiki | The Varint format]
  *  [./data_encoding.wiki | The Data Encoding]
  *  [./key_encoding.wiki | The Key Encoding]
  *  [./decimal.wiki | Internal representation of numeric values]
  *  [./porting.wiki | Porting an app from SQLite3 to SQLite4]
  *  [./storage.wiki | How to create a new storage engine]











>
1
2
3
4
5
6
7
8
9
10
11
<title>SQLite4</title>

  *  [./design.wiki | The Design Of SQLite4]
  *  [./env.wiki | The Run-time Environment Object]
  *  [./varint.wiki | The Varint format]
  *  [./data_encoding.wiki | The Data Encoding]
  *  [./key_encoding.wiki | The Key Encoding]
  *  [./decimal.wiki | Internal representation of numeric values]
  *  [./porting.wiki | Porting an app from SQLite3 to SQLite4]
  *  [./storage.wiki | How to create a new storage engine]
  *  [./lsmusr.wiki | LSM User Manual]