Commit Graph

115 Commits

Author SHA1 Message Date
Jan Hentschel b53f354763 HBASE-17532 Replaced explicit type with diamond operator
Signed-off-by: Michael Stack <stack@apache.org>
2017-03-07 11:22:51 -08:00
Andrew Purtell 404a2883f2 HBASE-17722 Metrics subsystem stop/start messages add a lot of useless bulk to operational logging 2017-03-03 12:40:06 -08:00
Apekshit Sharma 4d90425031 HBASE-17699 Fix TestLockProcedure.
Earlier when queues had locks, clearQueue() also cleaned up old locks when AbstractProcedureScheduler.clear() was called to reset scheduler for testing failure and recovery.
Now with locks decoupled from queues, they need to be separately cleaned up.
We can't have clearLocks() as abstract method in AbstractProcedureScheduler because at that level, a procedure scheduler is just a queue. It's only in MasterProcedureScheduler that locks come into picture. So directly overriding clear() method in MPS.

Earlier when queues had locks, clearQueue() also cleaned up old locks when AbstractProcedureScheduler.clear() was called.
Now with locks decoupled from queues, they need to be separately cleaned up.
We can't have clearLocks() as abstract method in AbstractProcedureScheduler because at that level, a procedure scheduler is just a queue. It's only in MasterProcedureScheduler that locks come into picture. So directly overriding clear() method in MPS.

Change-Id: If1a0acb418a79f98ce6155541edb0c1e621638e3
2017-02-26 15:32:31 -08:00
Apekshit Sharma 826b9436fb HBASE-17605 Changes
- Moved locks out of MasterProcedureScheduler#Queue. One Queue object is used for each namespace/table, which aren't more than 100. So we don't need complexity arising from all functionalities being in one place. SchemaLocking now owns locks and locking implementaion has been moved to procedure2 package.
- Removed NamespaceQueue because it wasn't being used as Queue (add,peek,poll,etc functions threw UnsupportedOperationException). It's was only used for locks on namespaces. Now that locks have been moved out of Queue class, it's not needed anymore.
- Remoed RegionEvent which was there only for locking on regions. Tables/namespaces used locking from Queue class and regions couldn't (there are no separate proc queue at region level), hence the redundance. Now that locking is separate, we can use the same for regions too.
- Removed QueueInterface class. No declarations, except one implementaion, which makes the point of having an interface moot.
- Removed QueueImpl, which was the only concrete implementation of abstract Queue class. Moved functions to Queue class itself to avoid unnecessary level in inheritance hierarchy.
- Removed ProcedureEventQueue class which was just a wrapper around ArrayDeque class. But we now have ProcedureWaitQueue as 'Type class'.
- Encapsulated table priority related stuff in a single class.
- Removed some unused functions.
Change-Id: I6a60424cb41e280bc111703053aa179d9071ba17
2017-02-11 14:31:43 -08:00
Zach York ae21797305 HBASE-17437 Support specifying a WAL directory outside of the root directory (Yishan Yang and Zach York)
Signed-off-by: Enis Soztutar <enis@apache.org>
2017-01-31 11:43:33 -08:00
Michael Stack 2511cc8278 HBASE-17569 HBase-Procedure module need to support mvn clean test -PskipProcedureTests to skip unit test (Yi Liang) 2017-01-30 20:36:15 -08:00
Michael Stack fb2c89b1b3 HBASE-16785 We are not running all tests
M TestStressWALProcedureStore.java
Disable test that now runs that fails because of difference in pb3.1.0.

Signed-off-by: Michael Stack <stack@apache.org>
2017-01-26 21:49:18 -08:00
Michael Stack 1ee8776273 HBASE-16785 We are not running all tests Do nothing patch just to get baseline of how many tests we run 2017-01-26 12:21:00 -08:00
Michael Stack 616f4801b0 HBASE-17067 Procedure v2 - remove tryAcquire*Lock and use wait/wake to make; ADDENDUM Address review comment by Stephen Yuan Jiang
framework event based
2017-01-23 22:57:45 -08:00
Michael Stack 980c8c2047 HBASE-17067 Procedure v2 - remove zklock/tryLock and use wait/wake (Matteo Bertozzi)
This is an amalgam of https://reviews.apache.org/r/54435/ and
9c14863594

Removes notion of suspend/resume from procedure. Instead have the below lock states
and just unschedule if lock is not yet available

 LOCK_ACQUIRED should be returned when the proc has the lock and the proc is ready to execute.
 LOCK_YIELD_WAIT should be returned when the proc has not the lock and the framework
   should take care of readding the procedure back to the runnable set for retry
 LOCK_EVENT_WAIT should be returned when the proc has not the lock and someone will take care of
  readding the procedure back to the runnable set when the lock is available.

Side benefit is being able to undo a bunch of synchronization around
procedure management.

Signed-off-by: Michael Stack <stack@apache.org>
2017-01-23 09:29:16 -08:00
Jan Hentschel 55a1aa1e73 HBASE-10699 Set capacity on ArrayList where possible and use isEmpty instead of size() == 0
Signed-off-by: Michael Stack <stack@apache.org>
2017-01-20 22:58:20 -08:00
Michael Stack 76dc957f64 HBASE-16786 Procedure V2 - Move ZK-lock's uses to Procedure framework locks (LockProcedure) - Matteo Bertozzi
Locks are no longer hosted up in zookeeper but instead by the Master.
2017-01-19 09:34:17 -08:00
Michael Stack 4cb09a494c HBASE-16744 Procedure V2 - Lock procedures to allow clients to acquire
locks on tables/namespaces/regions (Matteo Bertozzi)

Incorporates review comments from
    https://reviews.apache.org/r/52589/
    https://reviews.apache.org/r/54388/

M hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableBase.java
 Fix for eclipse complaint (from Duo Zhang)

M hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/Procedure.java
M hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
M hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
 Log formatting

M hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.java
 Added wait procedures utility.

A hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/LockServiceProtos.java
A hbase-protocol-shaded/src/main/protobuf/LockService.proto b/hbase-protocol-shaded/src/main/protobuf/LockService.proto
 Implement new locking CP overrides.

A hbase-server/src/main/java/org/apache/hadoop/hbase/client/locking/EntityLock.java
 New hbase entity lock (ns, table, or regions)

A hbase-server/src/main/java/org/apache/hadoop/hbase/client/locking/LockServiceClient.java
 Client that can use the new internal locking service.
2017-01-13 21:07:03 -08:00
Michael Stack da97569eae HBASE-17090 Procedure v2 - fast wake if nothing else is running (Matteo Bertozzi) 2016-12-27 16:19:32 -08:00
Michael Stack 319ecd867a HBASE-16524 Procedure v2 - Compute WALs cleanup on wal modification and not on every sync (Matteo Bertozzi)
Signed-off-by: Michael Stack <stack@apache.org>
2016-12-27 16:12:45 -08:00
Michael Stack da356069f2 HBASE-17149 Procedure v2 - Fix nonce submission
Signed-off-by: Michael Stack <stack@apache.org>
2016-12-16 21:41:18 -08:00
Michael Stack e16e2a61c1 HBASE-17148 Procedure v2 - add bulk proc submit (Matteo Bertozzi) 2016-12-16 13:15:35 -08:00
Matteo Bertozzi 1eb24e4e8e HBASE-17260 Procedure v2 - Add setOwner() overload taking a User instance 2016-12-06 10:32:43 -08:00
Stephen Yuan Jiang 0a24077841 HBASE-16119 Procedure v2 - Reimplement Merge region (Stephen Yuan Jiang) 2016-12-01 22:41:15 -08:00
Matteo Bertozzi efe0a0eead HBASE-16865 Procedure v2 - Inherit lock from root proc 2016-11-04 13:17:40 -07:00
Apekshit Sharma a3f1490601 HBASE-16950 Print raw stats in the end of proc performance tools for parsing results from scripts.
Change-Id: I45d77e838689dde7ec596de26ae98bd62e1b727e
2016-10-27 00:04:24 -07:00
Matteo Bertozzi 553373671b HBASE-16871 Procedure v2 - add waiting procs back to the queue after restart 2016-10-20 07:17:10 -07:00
Matteo Bertozzi d9ee25e82a HBASE-16874 Fix TestMasterFailoverWithProcedures and ensure single proc-executor for kill/restart tests 2016-10-19 13:25:17 -07:00
Matteo Bertozzi 82a2384187 HBASE-16864 Procedure v2 - Fix StateMachineProcedure support for child procs at last step 2016-10-19 06:58:41 -07:00
Matteo Bertozzi c6e9dabe62 HBASE-16846 Procedure v2 - executor cleanup 2016-10-17 10:30:59 -07:00
Matteo Bertozzi 62c84115ec HBASE-16839 Procedure v2 - Move all protobuf handling to ProcedureUtil 2016-10-14 11:32:28 -07:00
Hiroshi Ikeda 9a94dc90b4 HBASE-16642 Use DelayQueue instead of TimeoutBlockingQueue
Signed-off-by: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
2016-10-13 21:41:54 -07:00
Matteo Bertozzi 92ef234486 HBASE-16813 Procedure v2 - Move ProcedureEvent to hbase-procedure module 2016-10-12 16:33:25 -07:00
Matteo Bertozzi 662a1b241f HBASE-16802 Procedure v2 - group procedure cleaning 2016-10-11 16:48:21 -07:00
Matteo Bertozzi 29d701a314 HBASE-16781 Fix flaky TestMasterProcedureWalLease 2016-10-07 18:01:53 -07:00
anoopsamjohn 06758bf630 HBASE-16759 Avoid ByteString.copyFrom usage wherever possible. 2016-10-06 00:27:34 +05:30
stack 95c1dc93fb HBASE-15638 Shade protobuf
Which includes

    HBASE-16742 Add chapter for devs on how we do protobufs going forward

    HBASE-16741 Amend the generate protobufs out-of-band build step
    to include shade, pulling in protobuf source and a hook for patching protobuf

    Removed ByteStringer from hbase-protocol-shaded. Use the protobuf-3.1.0
    trick directly instead. Makes stuff cleaner. All under 'shaded' dir is
    now generated.

    HBASE-16567 Upgrade to protobuf-3.1.x
    Regenerate all protos in this module with protoc3.
    Redo ByteStringer to use new pb3.1.0 unsafebytesutil
    instead of HBaseZeroCopyByteString

    HBASE-16264 Figure how to deal with endpoints and shaded pb Shade our protobufs.
    Do it in a manner that makes it so we can still have in our API references to
    com.google.protobuf (and in REST). The c.g.p in API is for Coprocessor Endpoints (CPEP)

            This patch is Tactic #4 from Shading Doc attached to the referenced issue.
            Figuring an appoach took a while because we have Coprocessor Endpoints
            mixed in with the core of HBase that are tough to untangle (FIX).

            Tactic #4 (the fourth attempt at addressing this issue) is COPY all but
            the CPEP .proto files currently in hbase-protocol to a new module named
            hbase-protocol-shaded. Generate .protos again in the new location and
            then relocate/shade the generated files. Let CPEPs keep on with the
            old references at com.google.protobuf.* and
            org.apache.hadoop.hbase.protobuf.* but change the hbase core so all
            instead refer to the relocated files in their new location at
            org.apache.hadoop.hbase.shaded.com.google.protobuf.*.

            Let the new module also shade protobufs themselves and change hbase
            core to pick up this shaded protobuf rather than directly reference
            com.google.protobuf.

            This approach allows us to explicitly refer to either the shaded or
            non-shaded version of a protobuf class in any particular context (though
            usually context dictates one or the other). Core runs on shaded protobuf.
            CPEPs continue to use whatever is on the classpath with
            com.google.protobuf.* which is pb2.5.0 for the near future at least.

            See above cited doc for follow-ons and downsides. In short, IDEs will complain
            about not being able to find the shaded protobufs since shading happens at package
            time; will fix by checking in all generated classes and relocated protobuf in
            a follow-on. Also, CPEPs currently suffer an extra-copy as marshalled from
            non-shaded to shaded. To fix. Finally, our .protos are duplicated; once
            shaded, and once not. Pain, but how else to reveal our protos to CPEPs or
            C++ client that wants to talk with HBase AND shade protobuf.

            Details:

            Add a new hbase-protocol-shaded module. It is a copy of hbase-protocol
    i       with all relocated offset from o.a.h.h. to o.a.h.h.shaded. The new module
            also includes the relocated pb. It does not include CPEPs. They stay in
            their old location.

            Add another module hbase-endpoint which has in it all the endpoints
            that ship as part of hbase -- at least the ones that are not
            entangled with core such as AccessControl and Auth. Move all protos
            for these CPEPs here as well as their unit tests (mostly moving a
            bunch of stuff out of hbase-server module)

            Much of the change looks like this:

                 -import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
                 -import org.apache.hadoop.hbase.protobuf.generated.ClusterIdProtos;
                 +import org.apache.hadoop.hbase.protobuf.shaded.ProtobufUtil;
                 +import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterIdProtos;

            In HTable and in HBaseAdmin, regularize the way Callables are used and also hide
            protobuf usage as much as possible moving it up into Callable super classes or out
            to utility classes. Still TODO is adding in of retries, etc., but can wait on
            procedure which will redo all this.

            Also in HTable and HBaseAdmin as well as in HRegionServer and Server, be explicit
            when using non-shaded protobuf. Do the full-path so it is clear. This is around
            endpoint coprocessors registration of services and execution of CPEP methods.

            Shrunk ProtobufUtil by moving methods used by one CPEP only back to the CPEP either
            into Client class or as new Util class; e.g. AccessControlUtil.

            There are actually two versions of ProtobufUtil now; a shaded one and a subset
            that is used by CPEPs doing non-shaded work.

            Made it so hbase-common no longer depends on hbase-protocol (with Matteo's help)

            R*Converter classes got moved down under shaded package -- they are for internal
            use only. There are no non-shaded versions of these classes.

            D hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRegionServerCallable
            D RetryingCallableBase
             Not used anymore and we have too many tiers of Callables so removed/cleaned-up.

            A ClientServicecallable
             Had to add this one. RegionServerCallable was made generic so it could be used
             for a few Interfaces (Client and Admin). Then added ClientServiceCallable to
             implement RegionServerCallable with the Client Interface.
2016-10-03 21:37:32 -07:00
Matteo Bertozzi 8da0500e7d HBASE-16695 Procedure v2 - Support for parent holding locks 2016-09-26 08:42:48 -07:00
Matteo Bertozzi e01e05cc0e HBASE-16587 Procedure v2 - Cleanup suspended proc execution 2016-09-26 08:08:44 -07:00
Jonathan M Hsieh a90d433a2c HBASE-12088 Remove unused hadoop-1.0, hadoop-1.1 profiles from non-root poms 2016-09-21 20:45:03 -07:00
Apekshit Sharma b2eac0da33 HBASE-16554 Rebuild WAL tracker if trailer is corrupted.
Change-Id: Iecc3347de3de9fc57f57ab5f498aad404d02ec52
2016-09-19 12:23:48 -07:00
Matteo Bertozzi 9c58d26d3b HBASE-16507 Procedure v2 - Force DDL operation to always roll forward (addendum) 2016-09-18 19:37:46 -07:00
Apekshit Sharma da3abbcb35 HBASE-16534 Procedure v2 - Perf Tool for Scheduler.
Tool to test performance of locks and queues in procedure scheduler independently from other framework components.
Inserts table and region operations in the scheduler, then polls them and exercises their locks. Number of tables, regions and operations can be set using cli args.

Change-Id: I0fb27e67d3fcab70dd5d0b5197396b117b11eac6
2016-09-17 17:38:51 -07:00
Matteo Bertozzi 216e847366 HBASE-16639 TestProcedureInMemoryChore#testChoreAddAndRemove occasionally fails 2016-09-15 18:25:11 -07:00
tedyu e782d0bbdf HBASE-16640 TimeoutBlockingQueue#remove() should return whether the entry is removed 2016-09-15 17:34:23 -07:00
Matteo Bertozzi f6ccae3502 HBASE-16507 Procedure v2 - Force DDL operation to always roll forward 2016-09-01 21:06:32 -07:00
Apekshit Sharma 5c7fa12ab3 HBASE-16101 addendum. Fixes runtime ClassCastException of Future<Integer> in ProcedureWALPerformanceEvaluation.
Change-Id: Ibe4f3a001b4f50e8598e367cc8648aeae129eee8
2016-09-01 17:23:54 -07:00
tedyu 5376106d05 HBASE-16532 Procedure-V2: Enforce procedure ownership at submission 2016-08-31 12:55:54 -07:00
Matteo Bertozzi ea15522704 HBASE-16533 Procedure v2 - Extract chore from the executor 2016-08-30 18:40:51 -07:00
Apekshit Sharma c66bb48ce8 HBASE-16101 Tool to microbenchmark procedure WAL performance.
Change-Id: I8ec158319395d2ec8e36641a3beab2694f7b6aef
2016-08-30 13:31:58 -07:00
Matteo Bertozzi 97b164ac38 HBASE-16451 Procedure v2 - Test WAL protobuf entry size limit 2016-08-23 21:02:38 -07:00
Matteo Bertozzi 91fee265cf HBASE-16485 Procedure v2 - Add support to addChildProcedure() as last "step" in StateMachineProcedure 2016-08-23 16:42:57 -07:00
Matteo Bertozzi 34b668b0a9 HBASE-16452 Procedure v2 - Make ProcedureWALPrettyPrinter extend Tool 2016-08-19 10:09:25 -07:00
Apekshit Sharma ce88270340 HBASE-16094 Improve cleaning up of proc wals.
Makes the proc log cleaner smarter.
Current method: starting from oldest log, keep deleting WALs until we encounter one which contains state of an active proc. Note that the state may be stale.
New method: Same as current method, but will also delete the wals which contain stale state.
In the starting, iterate from newest completed log (just before currently active log) and mark it for delete if it doesn't contain any state which will be required in case of recovery.
Tested: unittests.

Change-Id: Ie7499652e25af4aac8e9d71a42d60c61a03fd4e4
2016-08-18 13:30:21 -07:00
Matteo Bertozzi e637a61e26 HBASE-16378 Procedure v2 - Make ProcedureException extend HBaseException 2016-08-17 14:31:08 -07:00