HBase backend: edges cannot be persisted and vertex ID mismatch
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- databases
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện sự cố thông qua backend HBase bằng các endpoint REST của vertex và edge cùng các điểm vào addE, g.V() và g.E() của Gremlin được mô tả ở đây. Truy vết việc xử lý ID của vertex và các đường dẫn lưu trữ bền vững của edge, sau đó xác minh rằng các ID được trả về hỗ trợ việc tra cứu và tạo edge, các edge vẫn tồn tại sau khi reload, các ID là duy nhất giữa các label, và số lượng edge khớp với các edge được lưu trữ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue Draft: HBase Backend - Edges Cannot Be Persisted
Environment
- HugeGraph: 1.7.0 (server), pyhugegraph: 1.7.0 (client)
- HBase: 2.1.2
- ID Strategy:
PRIMARY_KEY - Serializer:
binary
Description
When HugeGraph uses HBase as the backend storage, edges cannot be persisted regardless of the creation method used (REST API or Gremlin). Vertex creation works, but all edge creation approaches either fail explicitly or silently discard the data.
Reproduction Steps
Schema Setup
// Property keys
schema.propertyKey('name').asText().ifNotExist().create()
schema.propertyKey('date').asText().ifNotExist().create()
// Vertex label with PRIMARY_KEY strategy
schema.vertexLabel('person').properties('name').usePrimaryKeyId().primaryKeys('name').ifNotExist().create()
// Edge label
schema.edgeLabel('roommate').sourceLabel('person').targetLabel('person').properties('date').nullableKeys('date').ifNotExist().create()
Create Vertices
// REST API - works fine
POST /graphs/{graph}/graph/vertices
{"label": "person", "properties": {"name": "Alice"}}
{"label": "person", "properties": {"name": "Bob"}}
Response IDs: "1:Alice", "1:Bob" (composite format from PRIMARY_KEY strategy).
Attempt Edge Creation
Method 1: REST API with returned composite IDs — fails with error
POST /graphs/{graph}/graph/edges
{"label": "roommate", "outV": "1:Alice", "inV": "1:Bob", "properties": {"date": "2024"}}
→ 400 Bad Request: IllegalArgumentException: Invalid vertex id '1:Alice'
Method 2: REST API with actual stored IDs (from g.V().id()) — also fails
g.V().id() returns integers (e.g., 9988829793) instead of the composite IDs returned by addVertex. Using these:
POST /graphs/{graph}/graph/edges
{"label": "roommate", "outV": 9988829793, "inV": 9837833573, "properties": {"date": "2024"}}
→ 400 Bad Request: IllegalArgumentException: Invalid vertex id '9988829793'
Note: The vertex CAN be retrieved via REST API GET /vertices/9988829793 (returns 200), but edge creation rejects the same ID.
Method 3: Gremlin addE — appears to succeed but data is not persisted
g.V().hasLabel('person').has('name','Alice').addE('roommate').to(__.V().hasLabel('person').has('name','Bob')).property('date','2024')
Response: Returns the edge object with ID and properties (appears successful).
Verification:
g.E().count() → returns stale/incorrect count (e.g., 3)
g.E().toList() → returns [] (empty, correct)
GET /graph/edges → {"edges": []} (empty)
The edge is created in memory but not persisted to HBase.
Additional Observations
1. Vertex ID Mismatch
With PRIMARY_KEY strategy and HBase backend:
addVertexREST API returns composite IDs:"1:Alice"g.V().id()returns auto-generated integers:9988829793g.V().valueMap(true)returns the integer ID- The vertex is accessible via
GET /vertices/{integer_id}but NOT viaGET /vertices/1:Alice g.V({integer_id})lookup also returns empty (cannot find vertex by its own ID)
2. Vertex ID Collision Across Labels
Different vertex labels with different primary key values may share the same internal ID:
person:James (pk="James") → stored as 9837833573
webpage:James的个人网站 (pk="James的个人网站") → also stored as 9837833573
This suggests the HBase backend generates IDs based on a hash that ignores the vertex label, causing cross-label collisions.
3. g.E().count() Returns Incorrect Results
After Gremlin addE calls that don't persist:
g.E().count()may return a non-zero stale countg.E().toList()returns empty (correct)- REST API
/edgesreturns empty (correct)
Expected Behavior
- Edge creation via REST API should find vertices by the IDs returned by
addVertex - Edge creation via Gremlin
addEshould persist edges to the backend g.V().id()should return IDs that can be used for subsequent lookups and edge creation- Vertex IDs should be unique across different vertex labels
Actual Behavior
- No method of edge creation works with HBase backend
- Vertex IDs are inconsistent between
addVertexresponse andg.V().id() - Vertex IDs collide across labels
g.E().count()returns stale/incorrect counts
- Ngôn ngữ chính
- Java
- Star
- 3.2k
- Fork
- 641
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 74
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/hugegraph
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
apache/hugegraph#3231 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted improvement rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] CI accepts obsolete PR targets after retargeting or force-pushCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/hugegraph
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/rocketmq-dashboard#6872 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ADORSYS-GIS/token-status-link#168 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ADORSYS-GIS/keycloak-oid4vp-plugin#232 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Wrong link to test resultsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
docs(site): Mermaid edge-label contrast on Architecture and a table header on How it comparesĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
devops-thiago/ThrillhouseBot#1132 ·
Maintainer thường phản hồi trong vòng 1 ngày