Closign and opening a cachefile is now threadsafe (race condition when trying to open during a close).
If race condition hits, it will stall the open till the close is done.
All opens are now single threaded. This can be improved if it causes a bottleneck.
Added comments for possible future race conditions after lock refinement.
git-svn-id: file:///svn/toku/tokudb@11644 c7de825b-a66e-492c-adef-691d508d4ae1
When a new brt is open, it takes over responsibilities of all existing zombie brts, and closes them.
When a brt closes, if other brts exist, it passes off responsibilities and closes immediately. It only becomes a zombie if no other brts exist.
(Everything above is in context of a single header).
git-svn-id: file:///svn/toku/tokudb@11533 c7de825b-a66e-492c-adef-691d508d4ae1
See [11371] removed most of the causes of this (by limiting the places where refcount was edited).
Now (cachefile) refcounts are protected by the cachetable_lock.
git-svn-id: file:///svn/toku/tokudb@11408 c7de825b-a66e-492c-adef-691d508d4ae1
Remove transactions' need to count references to cachefiles (they already have references to brts)
Errors in rolling back certain functions were ignored (r = blah; return something_else);
They are now reported, so diskfull had to be updated to expect ENOSPC under certain circumstances.
git-svn-id: file:///svn/toku/tokudb@11371 c7de825b-a66e-492c-adef-691d508d4ae1
We clear it when the transaction closes (this means we cannot change it when it is already set till that transaction finishes).
This fixes a crash in windows in root_fifo_2.tdb
git-svn-id: file:///svn/toku/tokudb@11365 c7de825b-a66e-492c-adef-691d508d4ae1
A memory leak is exposed by src/tests/root_fifo_1.c
It gets cleaned up when the transaction commits, but our VM could grow unbounded meanwhile
git-svn-id: file:///svn/toku/tokudb@11309 c7de825b-a66e-492c-adef-691d508d4ae1
version now comes before 'size' in header
Some cleanup/defined new error codes instead of '-1'
git-svn-id: file:///svn/toku/tokudb@11304 c7de825b-a66e-492c-adef-691d508d4ae1
If descriptor contents stay the same but version goes up, record new version (instead of ignore it).
git-svn-id: file:///svn/toku/tokudb@11263 c7de825b-a66e-492c-adef-691d508d4ae1
Serialize descriptor with each brtnode (leaf and nonleaf)
Deserialize descriptor with each brtnode (to be thrown away).
Don't malloc+memdup the descriptor for brtnodes, since that would waste time.
git-svn-id: file:///svn/toku/tokudb@11200 c7de825b-a66e-492c-adef-691d508d4ae1
Added versioning to descriptor.
Changing a descriptor REQUIRES the version to increase.
Version 0 is reserved for a non-descriptor db. (cannot be set).
Not yet added to brtnodes.
Still possible to change descriptor with an open brt (which would not be upgraded).
git-svn-id: file:///svn/toku/tokudb@11198 c7de825b-a66e-492c-adef-691d508d4ae1
Do not compare idx and index in remove_txn and remove_brt. idx is from the iterating OMT and index is from the other OMT.
There is no reason they should match, therefore do not assert that they should
git-svn-id: file:///svn/toku/tokudb@11164 c7de825b-a66e-492c-adef-691d508d4ae1
Will aid in having multiple DB handles to a single brt, which is needed to kill root fifo
git-svn-id: file:///svn/toku/tokudb@11157 c7de825b-a66e-492c-adef-691d508d4ae1
Several fixes are included, particulary db remove after db truncate (with descriptor) does not crash anymore.
svn merge -r 10931:11019 ../tokudb.1510
git-svn-id: file:///svn/toku/tokudb@11020 c7de825b-a66e-492c-adef-691d508d4ae1