[0.89-fb] [HBASE-8228] Change the order of locks for HRegion.updatesLock and HLog.cacheFlushLock during a cache flush

Author: aaiyer

Summary:
We have seen cases where HLog.startCacheFlush() may block, waiting for a
compaction + log roll to complete; while holding the updatesLock for a region.

The waiting is fine. But, it is unacceptable to block all writes to the region
if the lock cannot be granted.

A long term fix to this is to get rid of the cacheFlushLock, since we no
longer write the complete flush entry in the log, and it can be deprecated.

For now, just change the order of locks for HRegion.updatesLock and HLog.cacheFlushLock during a cache flush

Test Plan: test suite; deploy/run on shadow

Reviewers: liyintang

Reviewed By: liyintang

CC: hbase-eng@, adela

Differential Revision: https://phabricator.fb.com/D867128

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1497992 13f79535-47bb-0310-9956-ffa450edef68