Repository navigation
Conversation
There was a problem hiding this comment.
license-eye has totally checked 893 files.
| Valid | Invalid | Ignored | Fixed |
|---|---|---|---|
| 670 | 3 | 220 | 0 |
Click to see the invalid file list
- hugegraph-api/src/main/java/org/apache/hugegraph/core/RoleTypeDataAdapterImpl.java
- hugegraph-api/src/main/java/org/apache/hugegraph/core/StateMachineCallbackImpl.java
- hugegraph-core/src/main/java/org/apache/hugegraph/election/HugeRoleStateMachineConfig.java
| @@ -0,0 +1,146 @@ | |||
| package org.apache.hugegraph.core; | |||
There was a problem hiding this comment.
| package org.apache.hugegraph.core; | |
| /* | |
| * Licensed to the Apache Software Foundation (ASF) under one or more | |
| * contributor license agreements. See the NOTICE file distributed with | |
| * this work for additional information regarding copyright ownership. | |
| * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| * (the "License"); you may not use this file except in compliance with | |
| * the License. You may obtain a copy of the License at | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| * See the License for the specific language governing permissions and | |
| * limitations under the License. | |
| */ | |
| package org.apache.hugegraph.core; |
| @@ -0,0 +1,74 @@ | |||
| package org.apache.hugegraph.core; | |||
There was a problem hiding this comment.
| package org.apache.hugegraph.core; | |
| /* | |
| * Licensed to the Apache Software Foundation (ASF) under one or more | |
| * contributor license agreements. See the NOTICE file distributed with | |
| * this work for additional information regarding copyright ownership. | |
| * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| * (the "License"); you may not use this file except in compliance with | |
| * the License. You may obtain a copy of the License at | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| * See the License for the specific language governing permissions and | |
| * limitations under the License. | |
| */ | |
| package org.apache.hugegraph.core; |
| @@ -0,0 +1,53 @@ | |||
| package org.apache.hugegraph.election; | |||
There was a problem hiding this comment.
| package org.apache.hugegraph.election; | |
| /* | |
| * Licensed to the Apache Software Foundation (ASF) under one or more | |
| * contributor license agreements. See the NOTICE file distributed with | |
| * this work for additional information regarding copyright ownership. | |
| * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| * (the "License"); you may not use this file except in compliance with | |
| * the License. You may obtain a copy of the License at | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| * See the License for the specific language governing permissions and | |
| * limitations under the License. | |
| */ | |
| package org.apache.hugegraph.election; |
c822b43 to
78cd8cd
Compare
Codecov Report
@@ Coverage Diff @@
## master #2130 +/- ##
============================================
+ Coverage 62.60% 68.86% +6.25%
- Complexity 728 977 +249
============================================
Files 481 488 +7
Lines 39704 40090 +386
Branches 5581 5608 +27
============================================
+ Hits 24857 27607 +2750
+ Misses 12389 9824 -2565
- Partials 2458 2659 +201
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
|
||
| private final TaskManager taskManager; | ||
|
|
||
| boolean isMaster = false; |
There was a problem hiding this comment.
the filed only use on one thread, so don't volatile
| import org.apache.hugegraph.util.Log; | ||
| import org.slf4j.Logger; | ||
|
|
||
| public class StateMachineCallbackImpl implements StateMachineCallback { |
There was a problem hiding this comment.
not submit StateMachineCallback file?
There was a problem hiding this comment.
This file is mainly responsible for state machine and external interactions, so it was not previously committed
| import org.apache.tinkerpop.gremlin.structure.T; | ||
| import org.apache.tinkerpop.gremlin.structure.Vertex; | ||
|
|
||
| public class RoleTypeDataAdapterImpl implements RoleTypeDataAdapter { |
There was a problem hiding this comment.
RoleTypeDataAdapter means RoleTypeStore?
There was a problem hiding this comment.
yes, the adapter responsibility mainly applies to storage
f7c2e6a to
5f17594
Compare
| E.checkArgument(this.roleStateWorker == null, "Repetition init"); | ||
| this.applyThread = Executors.newSingleThreadExecutor(); | ||
| this.roleStateWorker = this.authenticator().graph().roleElectionStateMachine(); | ||
| this.applyThread.execute(() -> { |
There was a problem hiding this comment.
can move applyThread to RoleElectionStateMachine class?
There was a problem hiding this comment.
It's easier to write a single test with asynchronous threads outside
|
Hi @zyxxoo , in the previous version, master schedule tasks and if the task is sent to the worker, will cause Exception 'Can't schedule task on non-master server'. |
yes, we will support redirect request to master node in this feature |
32075c4 to
fab5a17
Compare
|
|
||
| @Override | ||
| public void filter(ContainerRequestContext requestContext) throws IOException { | ||
| GlobalMasterInfo instance = GlobalMasterInfo.instance(); |
There was a problem hiding this comment.
get from graphManager.auth.masterInfo?
There was a problem hiding this comment.
I have change to "graphManager.globalMasterInfo"
| "server.role.node_external_url", | ||
| "The url of external accessibility", | ||
| disallowEmpty(), | ||
| "127.0.0.1:8080" |
There was a problem hiding this comment.
we can pass it from restserver config to graph config, like rpc url
There was a problem hiding this comment.
I'm a little confused about the question raised
now, I put the config to resetserver, but the stateMachine put in graph instance, so these config must be copy to graph config
5d065c8 to
85b722a
Compare
| @Status(Status.ACCEPTED) | ||
| @Produces(APPLICATION_JSON_WITH_CHARSET) | ||
| @RolesAllowed({"admin", "$owner=$graph $action=index_write"}) | ||
| @RedirectFilter.RedirectMasterRole |
There was a problem hiding this comment.
maybe ACCEPTED and RedirectMasterRole often appear simultaneously
There was a problem hiding this comment.
yes, if ACCEPTED appear, the RedirectMasterRole also appear
68e186e to
ae7954a
Compare
| E.checkArgumentNotNull(this.state, "State don't be null"); | ||
| try { | ||
| RoleState pre = this.state; | ||
| this.state = state.transform(context); |
There was a problem hiding this comment.
Note: state.transform is not an atomic operation
There was a problem hiding this comment.
the machine run in single thread
There was a problem hiding this comment.
taskManager and globalMadterInfo are use lock to sync
| @@ -234,7 +240,7 @@ public boolean updateIfNodePresent(RoleTypeData stateData) { | |||
| if (Objects.equals(value.node(), copy.node()) && | |||
There was a problem hiding this comment.
if the value could be null here?
There was a problem hiding this comment.
the value dont become null
|
不过目前来看, g.V().limit() 这条语句应该涉及不到 task, 这里应该有 bug |
我理解 |
ok, 看着这里执行任务应该创建了一个task 执行这条语句一直失败吗?后端用什么存储呢? |
一直失败,使用rocksdb存储。报错都是 |
|
@wuchaojing , 可以在检查下上面配置,应该是 ok的,拦截器没有漏 |


No description provided.