[master] KUDU-3017 clean-up SysCatalogTable::SetupTablet()

If master fails to replay orphaned operations from the WAL during
the bootstrap, it crashes at the system tablet's state check
(the 'orphaned operations' are REPLICATE messages which are in the WAL
with no accompanying COMMIT):

    F1206 01:32:15.488359 1324967 tablet_replica.cc:138] Check failed: state_ == SHUTDOWN || state_ == FAILED TabletReplica not fully shut down. State: BOOTSTRAPPING

This patch addresses the issue, so master would not crash at the tablet
state consistency CHECK() under such conditions.  Instead, now it
reports corresponding error and crashes at the higher level
in master_main.cc.  With this patch, it's easier to attribute
a failure to the root cause by looking into the master's log.

I didn't add any tests: the replay of the orphaned WAL transactions
during bootstrap has pretty good coverage already.

Change-Id: I6adfd7f74fdd2e05e04f6418cbf9bb86cad6465a
Reviewed-on: http://gerrit.cloudera.org:8080/14881
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <awong@cloudera.com>
3 files changed