-
Notifications
You must be signed in to change notification settings - Fork 575
BREAKING CHANGE: release version 1.7.0 [server + pd + store] #2889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd project configuration
* refactor: integrate store-grpc module * ref: change comments to en * reformat&add comments --------- Co-authored-by: Copilot <[email protected]>
* update: update workflow * fix: update workflow * update: change USE_STAGE param & add maven package param * update: add todo tag * Update check-dependencies.yml --------- Co-authored-by: imbajin <[email protected]>
* refactor(pd): added validation and refactor code
* refactor: integrate store-rocksdb module * update: change comments to en * fix: fix error logic * update: add tag
* fix(pd): resolving type inference issues
* refactor: integrate store-common module * update: add dependency statement in pom * fix: Correct spelling errors * update: simplify TABLES_MAP * fix: More robust type check * update: modify to en comments * update: modify to en comments & Fix some problem * fix: fix the error logic in AggregationFunctions.MinFunction * Trigger CI/CD
feat(pd): add MetadataService in pd
…ng across multiple classes
…n service classes
…s and Partition classes
…date flush method visibility - Change PartitionMetaStore.flush() from protected to public for broader access - Replace usage of DefaultDataMover with DataManagerImpl in HgStoreNodeService - Update Import and instantiation accordingly in StoreEngineTestBase - Enhance JavaDoc formatting in StoreEngineTestBase for better readability
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/auth/HugeAuthenticator.java
Fixed
Show fixed
Hide fixed
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/util/ZipUtils.java
Fixed
Show fixed
Hide fixed
…ator 1. Introduced a safe wildcard-based label matching method to prevent ReDoS attacks, replacing direct regex usage. 2. Refactored code for better readability, reordered admin checks, and made minor comment and formatting improvements throughout HugeAuthenticator.java. 3. Enhance zip extraction security with path validation
* chore(server): improve log clarity and add null checks in api * chore: bump version from 1.5.0 to 1.7.0 * chore: add todo in common pom.xml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2889 +/- ##
=============================================
+ Coverage 42.31% 93.25% +50.94%
+ Complexity 583 65 -518
=============================================
Files 756 9 -747
Lines 60475 267 -60208
Branches 7719 22 -7697
=============================================
- Hits 25589 249 -25340
+ Misses 32238 8 -32230
+ Partials 2648 10 -2638 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Upgraded CodeQL GitHub Actions to v3 for improved security and features. Enhanced .gitignore and pom.xml to exclude and clean up dist.sh files during build and packaging. Removed unused hugegraph-struct dependency from hugegraph-store. Updated NOTICE copyright year to 2025.
Enhanced internal authentication logic and documentation in Authentication.java, emphasizing production security best practices. Refactored TokenUtil for clarity and immutability. Improved code formatting in PDPulseTest and SampleRegister, and updated ServiceConstant with stricter external exposure warnings. --------- Co-authored-by: imbajin <[email protected]>
Introduced AGENTS.md files to the root and all major modules to provide AI coding tool guidance, including architecture, build, test, and development workflows for each component. Updated .gitignore to exclude various AI prompt files, ensuring only AGENTS.md is kept and others can be soft-linked as needed.
Added WARP.md to .gitignore. The HugeGraph PD README was significantly expanded with detailed overview, architecture, quick start instructions, configuration examples, API documentation, testing, Docker usage, production notes, and community resources.
Introduces a comprehensive architecture overview for HugeGraph PD, detailing system responsibilities, module structure, core components, Raft consensus integration, data flows, and inter-service communication. This document serves as a technical reference for developers and maintainers.
Introduces a comprehensive API reference for HugeGraph PD, detailing gRPC services, Protocol Buffers definitions, Java client usage, REST API endpoints, error handling, and best practices for integration and cluster management.
Introduces comprehensive documentation for HugeGraph PD, including a configuration guide covering deployment scenarios, parameter tuning, and monitoring, as well as a development guide detailing environment setup, build/test workflows, code style, debugging, and contribution processes.
* feat(server): implement dynamic monitoring and management of graph instance * refactor(server): consolidate authority setting in PdMetaDriver and HugeGraphServer * refactor(service): enhance comments for clarity and synchronize graph start method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This is a major breaking change release for version 1.7.0 that introduces multi-tenant GraphSpace architecture, Kubernetes native support, and a new modular structure through the hugegraph-struct module. The changes span across server, PD (Placement Driver), and store components with significant API path modifications and architectural improvements.
Key Changes:
- Introduction of graphspace path parameter across all API endpoints (breaking change)
- New hugegraph-struct module for core data structures and query abstractions
- Kubernetes integration for cloud-native deployment
- Enhanced authentication and authorization system
- PD service improvements with new gRPC methods and metadata services
Reviewed Changes
Copilot reviewed 189 out of 709 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/cypher/CypherAPI.java | Updated API path to include graphspace parameter and modified graph alias generation |
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/auth/*.java | Added graphspace path parameter to all authentication-related APIs |
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/API.java | Added helper methods for graphspace, service, and schema template retrieval |
| hugegraph-server/hugegraph-api/pom.xml | Added Kubernetes client dependency |
| hugegraph-server/AGENTS.md | New documentation file for AI coding tool guidance |
| hugegraph-pd/pom.xml | Added new hg-pd-cli module and dependency version properties |
| hugegraph-pd/hg-pd-test/src/main/java/org/apache/hugegraph/pd/service/*.java | New comprehensive test suites for PD services |
| hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/watch/*.java | Refactored watch subjects with improved string building and concurrency handling |
| hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/service/PDService.java | Major refactor with new gRPC methods for graph stats, index tasks, and metadata management |
| hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/service/interceptor/*.java | New authentication framework for gRPC and REST services |
| hugegraph-pd/hg-pd-grpc/src/main/proto/pd_pulse.proto | Added build_index field to PartitionHeartbeatResponse |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Map<String, String> aliases = new HashMap<>(1, 1); | ||
| aliases.put("g", "__g_" + graph); | ||
| String graphInfo = graphspace + "-" + graph; | ||
| Map<String, String> aliases = new HashMap<>(2, 1); |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HashMap is initialized with a load factor of 1, which will cause immediate resizing when a second element is added. Use the default load factor of 0.75 by calling new HashMap<>(2) instead, or increase the initial capacity to 3 to accommodate 2 elements without resizing.
| Map<String, String> aliases = new HashMap<>(2, 1); | |
| Map<String, String> aliases = new HashMap<>(3); |
| Set<Map.Entry<String, String>> set = clientKeys.entrySet(); | ||
| for (Map.Entry<String, String> keyEntry : set) { |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intermediate variable set is unnecessary. Iterate directly over clientKeys.entrySet() to simplify the code: for (Map.Entry<String, String> keyEntry : clientKeys.entrySet()).
| Set<Map.Entry<String, String>> set = clientKeys.entrySet(); | |
| for (Map.Entry<String, String> keyEntry : set) { | |
| for (Map.Entry<String, String> keyEntry : clientKeys.entrySet()) { |
| String suffix = "/g"; | ||
| if (gssGraph.split("/").length > 2 && !graphName.endsWith(suffix)) { | ||
| graphName += suffix; | ||
| } |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suffix variable is defined locally but represents a constant value. Consider defining it as a class-level constant (e.g., private static final String GRAPH_NAME_SUFFIX = \"/g\";) to improve maintainability and reusability.
| private static String DATE = "yyyy-MM-dd"; | ||
| private static String DATETIME = "yyyy-MM-dd HH:mm:ss"; | ||
| private static String DATETIME_MM = "yyyy-MM-dd HH:mm"; | ||
| private static String DATETIME_SSS = "yyyy-MM-dd HH:mm:ss.SSS"; | ||
| private static String TIME = "HH:mm"; | ||
| private static String TIME_SS = "HH:mm:ss"; | ||
| private static String SYS_DATE = "yyyy/MM/dd"; | ||
| private static String SYS_DATETIME = "yyyy/MM/dd HH:mm:ss"; | ||
| private static String SYS_DATETIME_MM = "yyyy/MM/dd HH:mm"; | ||
| private static String SYS_DATETIME_SSS = "yyyy/MM/dd HH:mm:ss.SSS"; | ||
| private static String NONE_DATE = "yyyyMMdd"; | ||
| private static String NONE_DATETIME = "yyyyMMddHHmmss"; | ||
| private static String NONE_DATETIME_MM = "yyyyMMddHHmm"; | ||
| private static String NONE_DATETIME_SSS = "yyyyMMddHHmmssSSS"; | ||
| private static String[] PATTERNS = new String[]{ |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These pattern strings should be declared as static final constants rather than mutable static fields. Change private static String to private static final String for all pattern fields to prevent accidental modification and clearly indicate they are constants.
| private static String DATE = "yyyy-MM-dd"; | |
| private static String DATETIME = "yyyy-MM-dd HH:mm:ss"; | |
| private static String DATETIME_MM = "yyyy-MM-dd HH:mm"; | |
| private static String DATETIME_SSS = "yyyy-MM-dd HH:mm:ss.SSS"; | |
| private static String TIME = "HH:mm"; | |
| private static String TIME_SS = "HH:mm:ss"; | |
| private static String SYS_DATE = "yyyy/MM/dd"; | |
| private static String SYS_DATETIME = "yyyy/MM/dd HH:mm:ss"; | |
| private static String SYS_DATETIME_MM = "yyyy/MM/dd HH:mm"; | |
| private static String SYS_DATETIME_SSS = "yyyy/MM/dd HH:mm:ss.SSS"; | |
| private static String NONE_DATE = "yyyyMMdd"; | |
| private static String NONE_DATETIME = "yyyyMMddHHmmss"; | |
| private static String NONE_DATETIME_MM = "yyyyMMddHHmm"; | |
| private static String NONE_DATETIME_SSS = "yyyyMMddHHmmssSSS"; | |
| private static String[] PATTERNS = new String[]{ | |
| private static final String DATE = "yyyy-MM-dd"; | |
| private static final String DATETIME = "yyyy-MM-dd HH:mm:ss"; | |
| private static final String DATETIME_MM = "yyyy-MM-dd HH:mm"; | |
| private static final String DATETIME_SSS = "yyyy-MM-dd HH:mm:ss.SSS"; | |
| private static final String TIME = "HH:mm"; | |
| private static final String TIME_SS = "HH:mm:ss"; | |
| private static final String SYS_DATE = "yyyy/MM/dd"; | |
| private static final String SYS_DATETIME = "yyyy/MM/dd HH:mm:ss"; | |
| private static final String SYS_DATETIME_MM = "yyyy/MM/dd HH:mm"; | |
| private static final String SYS_DATETIME_SSS = "yyyy/MM/dd HH:mm:ss.SSS"; | |
| private static final String NONE_DATE = "yyyyMMdd"; | |
| private static final String NONE_DATETIME = "yyyyMMddHHmmss"; | |
| private static final String NONE_DATETIME_MM = "yyyyMMddHHmm"; | |
| private static final String NONE_DATETIME_SSS = "yyyyMMddHHmmssSSS"; | |
| private static final String[] PATTERNS = new String[]{ |
| shard.address = (s != null) ? s.getAddress() : ""; | ||
| if (s == null) { | ||
| log.error("store not found for shard storeId={}, partitionId={}", | ||
| shard.storeId, partition.getId()); |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The null check for store s is performed twice - once in the ternary operator and again in the if statement. Consider restructuring to eliminate redundancy: check for null once, log the error, and set the address in a single conditional block.
| shard.address = (s != null) ? s.getAddress() : ""; | |
| if (s == null) { | |
| log.error("store not found for shard storeId={}, partitionId={}", | |
| shard.storeId, partition.getId()); | |
| if (s == null) { | |
| log.error("store not found for shard storeId={}, partitionId={}", | |
| shard.storeId, partition.getId()); | |
| shard.address = ""; | |
| } else { | |
| shard.address = s.getAddress(); |
| } | ||
|
|
||
| String name = info.substring(0, delim); | ||
| //String pwd = info.substring(delim + 1); |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out password extraction code suggests incomplete implementation. Either remove the commented code if password validation is intentionally not implemented, or implement proper password verification if it's a work-in-progress feature.
| //String pwd = info.substring(delim + 1); |
Expanded README.md with detailed overview, architecture, configuration, deployment, integration, and operational guidance for HugeGraph Store. Added new documentation files covering distributed architecture, integration guide, operations guide, and query engine to provide in-depth technical reference for users and developers.
Introduces three new documentation files: best-practices.md, deployment-guide.md, and development-guide.md for HugeGraph Store. These guides cover production best practices, deployment topologies and steps, and developer environment setup and architecture, improving onboarding and operational clarity.
Core Changes Summary
📊 Overall Statistics
🎯 Core Architecture Changes
1. New Module Introduction: hugegraph-struct (Biggest Change)
This is the most critical change in this PR, introducing a brand new
hugegraph-structmodule with 16,691 lines of new code.Architecture Intent: Extract core data structures, queries, serialization and other foundational components into an independent module to achieve layered decoupling.
2. GraphSpace Multi-tenant Architecture Upgrade
New GraphSpace service registration and discovery mechanism:
New API:
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/space/GraphSpaceAPI.java[414 lines]3. Kubernetes Native Support
Brand new K8s integration module:
Purpose: Support service discovery and management in Kubernetes environments.
4. Authentication & Authorization System Upgrade
5. Storage Layer Query Enhancement (hugegraph-store)
Added 13,791 lines of code, mainly focused on query optimization:
6. PD (Placement Driver) Service Enhancement
Added 7,161 lines of code:
7. GraphManager Core Refactor
This is the largest change in a single file with a major refactor of the core graph manager.
🏗️ Architecture Evolution Diagram
Old Architecture vs New Architecture
graph TB subgraph "New Architecture (v1.7.0)" A1[hugegraph-api] --> B1[hugegraph-core] B1 --> C1[hugegraph-struct 🆕] B1 --> D1[K8s Integration 🆕] B1 --> E1[GraphSpace Service 🆕] F1[hugegraph-store] --> G1[Query Engine Enhanced] F1 --> H1[TTL Cleaner 🆕] F1 --> I1[Aggregation 🆕] J1[hugegraph-pd] --> K1[Service Discovery Enhanced] C1 -.Decoupled.-> B1 C1 -.Decoupled.-> F1 E1 --> D1 E1 --> L1[PD Register 🆕] E1 --> M1[Eureka Support 🆕] end subgraph "Old Architecture" A2[hugegraph-api] --> B2[hugegraph-core] B2 --> C2[Embedded Structures] F2[hugegraph-store] --> G2[Basic Query] J2[hugegraph-pd] end style C1 fill:#90EE90 style D1 fill:#90EE90 style E1 fill:#90EE90 style G1 fill:#FFD700 style H1 fill:#90EE90 style I1 fill:#90EE90 style K1 fill:#FFD700Module Dependency Relationships
🔑 Key Feature Changes
✅ New Features
Multi-tenant GraphSpace Management
Kubernetes Native Integration
Query Capability Enhancement
Data Lifecycle Management
Authentication & Authorization V2
🔄 Refactoring & Optimization
Core Structure Separation
hugegraph-structmoduleStorage Engine Optimization
Test Coverage Enhancement
📈 Change Heatmap
🎨 Data Flow Architecture Diagram
sequenceDiagram participant Client participant API as GraphSpaceAPI participant GM as GraphManager participant Auth as AuthV2 participant Core as hugegraph-core participant Struct as hugegraph-struct participant Store as hugegraph-store participant PD as hugegraph-pd participant K8s as K8s Service Client->>API: GraphSpace Request API->>Auth: Authentication Check Auth-->>API: Auth Passed API->>GM: Graph Management Operation GM->>Struct: Query/Schema Processing Struct->>Struct: Query Parsing Struct->>Struct: Serialization Processing Struct->>Store: Storage Layer Query Store->>Store: QueryExecutor Execution Store->>Store: Aggregation Store-->>GM: Return Results par Service Registration Core->>PD: PD Registration Core->>K8s: K8s Registration end GM-->>API: Processing Results API-->>Client: Response📊 Code Quality Metrics
Modularity Improvement
Test Coverage
🚀 Technical Highlights
High Priority Considerations
Summary
This is a major architecture upgrade PR that primarily implements:
Architecture Evolution Direction: Evolving from monolithic architecture toward microservices, cloud-native, and multi-tenant architecture.