HBASE-16532 Procedure-V2: Enforce procedure ownership at submission
This commit is contained in:
parent
605af95132
commit
5376106d05
|
@ -246,6 +246,9 @@ public class ProcedureExecutor<TEnvironment> {
|
|||
private final ProcedureStore store;
|
||||
private final Configuration conf;
|
||||
|
||||
private static final String CHECK_OWNER_SET_CONF_KEY = "hbase.procedure.check.owner.set";
|
||||
private final boolean checkOwnerSet;
|
||||
|
||||
private Thread[] threads;
|
||||
|
||||
public ProcedureExecutor(final Configuration conf, final TEnvironment environment,
|
||||
|
@ -259,6 +262,7 @@ public class ProcedureExecutor<TEnvironment> {
|
|||
this.runnables = runqueue;
|
||||
this.store = store;
|
||||
this.conf = conf;
|
||||
this.checkOwnerSet = conf.getBoolean(CHECK_OWNER_SET_CONF_KEY, true);
|
||||
}
|
||||
|
||||
private void load(final boolean abortOnCorruption) throws IOException {
|
||||
|
@ -640,6 +644,9 @@ public class ProcedureExecutor<TEnvironment> {
|
|||
Preconditions.checkArgument(isRunning());
|
||||
Preconditions.checkArgument(lastProcId.get() >= 0);
|
||||
Preconditions.checkArgument(!proc.hasParent());
|
||||
if (this.checkOwnerSet) {
|
||||
Preconditions.checkArgument(proc.hasOwner());
|
||||
}
|
||||
|
||||
// Initialize the Procedure ID
|
||||
long currentProcId = nextProcId();
|
||||
|
|
|
@ -21,8 +21,15 @@
|
|||
*/
|
||||
-->
|
||||
<configuration>
|
||||
<property>
|
||||
<property>
|
||||
<name>hbase.procedure.store.wal.use.hsync</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>hbase.procedure.check.owner.set</name>
|
||||
<value>false</value>
|
||||
<description>Whether ProcedureExecutor should enforce that each
|
||||
procedure to have an owner
|
||||
</description>
|
||||
</property>
|
||||
</configuration>
|
||||
|
|
Loading…
Reference in New Issue