fix name of slowNightly scons target
implement rollback for modifications to the NamespaceIndex
closes #19

This is a squash commit of:

Implement a version of namespace index rollback that refreshes any namespaces touched. Just the framework is implemented, not the calling code.

Fix rollback algorithm for the namespace index, remove manual rollback code, fix various bugs.

Make this public, use with caution.

Remove one check for fileops during multi-statement transactions

Change the behavior of aborting fileops. Ensure that we have a write lock to modify the nsindex.

Clean up the abort hook for fileops. Still need to fix
RetryWithWriteLock when calling open_ns on something that does not exist
(say, because the create was just rolled back)

Defer write lock aquisition until after we find something in the nsdb to
open. Do the same for close_ns.

Further a test, remove some checks for fileops during multi-statement
transactions.

Add a test

Use rollback information to invalidate a namespace after a failed index
create. Also, fix up a test to validate this change.

When dropping an index, note the namespace so rollback invalidates the
in-memory metadata. Add a test to prove that it works, and rename the
original addindex test to something better.

Move locking into namespace_details.cpp, which is necessary because
txn_context.cpp isn't part of coredb and can't find Lock::* symbols.

Fix up tests to be less brittle and more correct.

Fix a test, improve a comment, and add an assert that will hopefully
catch bugs

Use the current transaction when opening a dictionary, which prevents
some DB_LOCK_NOTGRANTED errors in the same statement. Also, only close
namespcaes on rollback if the database is still open (not the case after
drop())

Add a test for rollback of a dropDatabase. It does not pass yet.

Lazily open collections and the namespace index itself. Always try to
initialize it before use and protect _init with a mutex. It's only valid
to open/create the nsdb in a DBRead lock while holding that mutex.
Further, fix up the storage transaction to use a client's transaction
anytime it exists and is not read-only. This covers the may_create case,
and it also covers some other important cases that would otherwise
cause clients to get DB_LOCK_NOTGRANTED with themselves.

Use a BasicCursor directly instead of going through
Helpers::findTableScan, which will call nsdetails and open an ns before
the create path has time to call ni->add_ns. This sounds complicated but
the real issue is that Helpers::* is too high-level for createIndex.

Fix an off-by-correct bug in TxnContext::readOnly(), enhance the drop
database test a bit.

Add a test for dropping a collection in a multi-statement transaction.
It passes.

Open the namespace after rename to help enforce invariants. More
importantly, note a namespace in the rollback when doing update_ns,
since that operation is called during bigger operations that may end
up opening or closing a namespace for drop/rename/create, and we want
that to get rolled back.

Fix a bug where we'd incorrectly open the nsindex in close_ns. We only
need to return false if the ns was not open and thus not closed.

Disable dropDatabase in a multi-statement transaction while we
do not have the time/motivation to test/bugfix it. Use an alternate
transaction to open any dictionary when the caller is read-only
or has no transaction (we don't need to roll back the open, nor
hold on to any of the row locks acquired).

Hold a write lock on the proper ns during nsindex rollback instead of a
global write lock. Similarly, hold at least a read lock during insert
rollback for capped collections.

Add a test for substatement errors and how they interact with the master
transaction. Include cases for capped collections and fileops.

Simplify locking on abort.

Test file-ops gymnastics on one thread while another does continuous
point queries.

Drop database before running each rollback test

Never create the nsindex outside of a read lock. It is okay and expected
to open an existing nsdb in a read lock, but it's problematic to create
and then rollback having nsdb refer to an aborted index. It's easier to
just not create instead of handling the rollback with a special case.

Fix the dropDatabase bug by iterating system.namespaces to look for
collections to drop, not by relying on what's open in _namespaces.

Merge master onto rollback

Remove some prints

Some changes from review with Leif
implement getNamespaces with a DBC and redo some commands to retry with write lock
closes #25
the _namespaces map doesn't need to be a pointer now, an empty map is fine
closes #28
add close() to index and collection, to close DB* before destructor
closes #29
add transaction to CursorWithContext, remove from PipelineCommand refs #30
refs #6018, write concern work
reorganize transactions in MigrateFromStatus::apply, and set lastGTID accordingly #20
refs #6018, handle slave delay
refs #6018, fix a bug
refs #6018, remove threadpools used for prefetching and writing used by vanilla's replication
refs #6018, remove some dead code
refs #6018, while investigating background threads and how they relate to replication, killed FileAllocator thread
refs #6018, small fixes to order transactions get created
refs #6018 fix mongos segfault
fix a few warnings that compiling with --clang raised
add txn complete hooks to tool.cpp
closes #35
#36 dump restore tests fail due to indexing diff
refs #6018, finish off write concern
Merge branch 'master' of github.com:Tokutek/mongo