hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Jiang <syuanjiang...@gmail.com>
Subject Why TableNamespaceManager#upsert abort master if failing to update zookeeper
Date Fri, 17 Jul 2015 23:24:35 GMT
I am working on moving namespace DDL to Proc-V2 and come to see this code.
Looks like the logic exists since St.Ack implemented namespace in
HBASE-8408.

I just wonder whether the failure of zookeeper update is serve enough to
shut down master (in my new code, I don't abort - I want to make sure that
the abort is not needed - note the upsert would fail if zookeep update
fails and rollback in my new code - so we will not have orphaned ns table
row)

  private void upsert(Table table, NamespaceDescriptor ns) throws
IOException {

    validateTableAndRegionCount(ns);

    Put p = new Put(Bytes.toBytes(ns.getName()));

    p.addImmutable(HTableDescriptor.NAMESPACE_FAMILY_INFO_BYTES,

        HTableDescriptor.NAMESPACE_COL_DESC_BYTES,

        ProtobufUtil.toProtoNamespaceDescriptor(ns).toByteArray());

    table.put(p);

    try {

      zkNamespaceManager.update(ns);

    } catch(IOException ex) {

      String msg = "Failed to update namespace information in ZK. Aborting."
;

      LOG.fatal(msg, ex);

      masterServices.abort(msg, ex);

    }

  }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message