Comments (6)
Hi, your understanding is generally correct. The master/slaver design is mainly used to perform asynchronous tasks. The master node distributes tasks and the slave performs tasks. For requests that need to create tasks, such as rebuilding the index, the request needs to be redirected to the master. No. CRUD requests that need to create tasks do not need to go through the master. If we only have one node, there will be a single point problem.
VertexApi/EdgeApi does not create asynchronous tasks, so it can be executed on the any both node
from incubator-hugegraph.
but why do GremlinApi need this annotation? see this https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java and following code.
@POST
@Timed
@Compress
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RedirectFilter.RedirectMasterRole
public Response post(@Context HugeConfig conf,
@Context HttpHeaders headers,
String request) {
/* The following code is reserved for forwarding request */
// context.getRequestDispatcher(location).forward(request, response);
// return Response.seeOther(UriBuilder.fromUri(location).build())
// .build();
// Response.temporaryRedirect(UriBuilder.fromUri(location).build())
// .build();
String auth = headers.getHeaderString(HttpHeaders.AUTHORIZATION);
Response response = this.client().doPostRequest(auth, request);
GREMLIN_INPUT_HISTOGRAM.update(request.length());
GREMLIN_OUTPUT_HISTOGRAM.update(response.getLength());
return transformResponseIfNeeded(response);
}
from incubator-hugegraph.
another issue is that the Apis that add and update vertex/edge/index label won't create async task as well, but these apis are also annotated with RedirectMasterRole. Some of the references can be viewed as following:
- org.apache.hugegraph.api.schema.VertexLabelAPI#create
- org.apache.hugegraph.api.schema.VertexLabelAPI#update
I cannot find any clue to create async tasks in the schema update/add code.
protected void updateSchema(SchemaElement schema,
Consumer<SchemaElement> updateCallback) {
LOG.debug("SchemaTransaction update {} with id '{}'",
schema.type(), schema.id());
this.saveSchema(schema, true, updateCallback);
}
protected void addSchema(SchemaElement schema) {
LOG.debug("SchemaTransaction add {} with id '{}'",
schema.type(), schema.id());
setCreateTimeIfNeeded(schema);
this.saveSchema(schema, false, null);
}
Thx.
from incubator-hugegraph.
Thank you for your question. It seems that this annotation is not needed in these places. I will wait for other people in the community to see their opinions.
from incubator-hugegraph.
Do U have a realtime communication way, like Zoom or wechat meeting, to discuss some technique problem? so that I can report some concurrent safety issues and related concerns which are to some extent hard to describe in github.
Just ignore the above request. It's fine to use github issue and PR workflow. let's respect the method that an open-source project often operates.
from incubator-hugegraph.
Do U have a realtime communication way, like Zoom or wechat meeting, to discuss some technique problem? so that I can report some concurrent safety issues and related concerns which are to some extent hard to describe in github.Just ignore the above request. It's fine to use github issue and PR workflow. let's respect the method that an open-source project often operates.
Thank you for your understanding and support. We also have groups to discuss issues and more documents. You can send me an email (as I'm not sure about your email address)
BTW, current master-worker
mechanism will be replaced by PD in future (refer #2265)
from incubator-hugegraph.
Related Issues (20)
- [Question] There is no demo of how creating a graph through GraphAPI in test module and I had try client.post() failed. HOT 13
- [Question] How to check hugegraph node(role) status like master-worker? HOT 3
- [Question] When vertex strategy is CUSTOMIZE_UUID, is there need to pass the id value in json? HOT 6
- [Question] Run hugegraph-server in docker failed (Legacy version) HOT 9
- 怎么访问边和顶点的属性? HOT 5
- 【2024 OSPP/GLCC】Welcome to Apache HugeGraph (Colleges & Student)
- [Bug] query vertices by verticesId can not found, but has this vertices HOT 2
- [Question] create edge use uuid as vertices id, but tips "Invalid vertex id" HOT 2
- [Question] create edge use uuid as vertices id, but tips "Invalid vertex id" HOT 2
- [Question] How to use the gremlin statement to trigger oltp query HOT 4
- [Question] CypherAPI HOT 2
- 增加版本信息支持外部索引
- [Question] 配置的是pgsql,为什么连接用mysql,连接失败 HOT 3
- [Question] 创建顶点的时候,使用.ifNotExist()判断,但是还是出现下面错误 HOT 1
- [Bug] connect graph error in the hubble HOT 1
- 创建一个新的图,可以和原来的图共同存储在同一个mysql后端中吗?
- [Question] Vulnerability found in dependency: CVE-2022-42889 9.8 Transitive Improper Control of Generation of Code ("Code Injection") vulnerability with High severity found HOT 2
- [Summary] update license for 1.5 HOT 1
- [Question] gremlin-groovy is not an available GremlinScriptEngine HOT 1
- [Question] gremlin-groovy is not an available GremlinScriptEngine HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-hugegraph.