apache/incubator-phoenix — pull request #21 by jyates (2014-03-18 18:56:23+00:00)
Title: Removing holding log locks for updates

Now we do all the writes during postBatchMutate. This effectively ends up
serializing writes under the mvcc number (since updates wait on their
write to be visible before returning), but ensures that the correct locks
are released at the correct time.

Because of the above locking/mvcc situation, indexing needs to be part of
hbase core; it would allow it to be a bit more fine grained in the use of
locks mvcc. However, until that point, this is the correct solution - regardless
of whether or not its faster/slower.

The change is necessary because the LogRoll locks caused a deadlock on the
log roll/cache flush on server shutdown in our (Salesforce.com) internal
environment. Essentially, we think an exception was thrown while writing
to the WAL during batchMutate. This then caused the INDEX_UPDATE_LOCK
to never be released. Since this lock is waited on during logArchive,
the archiver was blocked there

Also, this update removes special handling of deletes. Since HBase 0.96,
Deletes and Puts both go through HRegion#batchMutate, so we can get rid
of the special casing for preDelete. This doesn't apply to any branch
running on HBase 0.94