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

Overview
Comment:Fix invocation of work-hook following an lsmTreeMakeOld() call.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | rework-flow-control
Files: files | file ages | folders
SHA1: 0a45bfc7a47beb62fe1f45d61ee5dfa8b11a73cd
User & Date: dan 2012-09-26 15:23:51.439
Context
2012-09-26
15:38
Merge rework-flow-control branch with trunk. check-in: cf2ef747ad user: dan tags: trunk
15:23
Fix invocation of work-hook following an lsmTreeMakeOld() call. Leaf check-in: 0a45bfc7a4 user: dan tags: rework-flow-control
14:07
Fix a broken assert() statement. check-in: 797f6c5578 user: dan tags: rework-flow-control
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/lsm_shared.c.
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834



835
836
837
838
839
840
841
** structure have already been restored. In either case, this function 
** merely releases locks and other resources held by the write-transaction.
**
** LSM_OK is returned if successful, or an LSM error code otherwise.
*/
int lsmFinishWriteTrans(lsm_db *pDb, int bCommit){
  int rc = LSM_OK;
  int bAutowork = 0;

  lsmLogEnd(pDb, bCommit);
  if( rc==LSM_OK && bCommit && lsmTreeSize(pDb)>pDb->nTreeLimit ){
    bAutowork = pDb->bAutowork;
    lsmTreeMakeOld(pDb);
  }
  lsmTreeEndTransaction(pDb, bCommit);

  if( rc==LSM_OK && bAutowork ){
    rc = lsmSortedAutoWork(pDb, 1);
  }
  lsmShmLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_UNLOCK, 0);



  return rc;
}


/*
** Return non-zero if the caller is holding the client mutex.
*/







|



|




|



>
>
>







815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
** structure have already been restored. In either case, this function 
** merely releases locks and other resources held by the write-transaction.
**
** LSM_OK is returned if successful, or an LSM error code otherwise.
*/
int lsmFinishWriteTrans(lsm_db *pDb, int bCommit){
  int rc = LSM_OK;
  int bFlush = 0;

  lsmLogEnd(pDb, bCommit);
  if( rc==LSM_OK && bCommit && lsmTreeSize(pDb)>pDb->nTreeLimit ){
    bFlush = 1;
    lsmTreeMakeOld(pDb);
  }
  lsmTreeEndTransaction(pDb, bCommit);

  if( rc==LSM_OK && bFlush && pDb->bAutowork ){
    rc = lsmSortedAutoWork(pDb, 1);
  }
  lsmShmLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_UNLOCK, 0);
  if( bFlush && pDb->bAutowork==0 && pDb->xWork ){
    pDb->xWork(pDb, pDb->pWorkCtx);
  }
  return rc;
}


/*
** Return non-zero if the caller is holding the client mutex.
*/