incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

[Bug] Can not delete vertex labels when use standalone mode and set server.role=computer

Open shirleyStorage opened this issue 2 years ago • 4 comments

Bug Type (问题类型)

rest-api (结果不合预期)

Before submit

  • [X] 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.0.0 (Apache Release Version)
  • Backend: RocksDB x nodes, HDD or SSD
  • OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x
  • Data Size: xx vertices, xx edges

Expected & Actual behavior (期望与实际表现)

curl -X POST http://localhost:8080/graphs/hugegraph/schema/propertykeys \
-H "Content-Type: application/json" \
-d '
{
    "name": "name",
    "data_type": "TEXT",
    "cardinality": "SINGLE"
}
';

curl -X POST http://localhost:8080/graphs/hugegraph/schema/propertykeys \
-H "Content-Type: application/json" \
-d '
{
    "name": "age",
    "data_type": "INT",
    "cardinality": "SINGLE"
}
';

curl -X POST http://localhost:8080/graphs/hugegraph/schema/vertexlabels \
     -H "Content-Type: application/json" \
     -d '{
    "name": "person",
    "id_strategy": "DEFAULT",
    "properties": [
        "name",
        "age"
    ],
    "primary_keys": [
        "name"
    ],
    "nullable_keys": [],
    "enable_label_index": true
}
';

curl -X DELETE http://localhost:8080/graphs/hugegraph/schema/vertexlabels/person ;


Vertex/Edge example (问题点 / 边数据举例)

curl -X DELETE http://localhost:8080/graphs/hugegraph/schema/vertexlabels/person

return :

Can't schedule task on non-master server


### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

shirleyStorage avatar Oct 11 '24 16:10 shirleyStorage

You can't delete vertex labels in standalone mode with server.role set to computer because the server is not a master. In HugeGraph, tasks like deleting vertex labels must be scheduled on a master server. The error message "Can't schedule task on non-master server" indicates that the operation is being attempted on a non-master server, which is not allowed [1][2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Oct 11 '24 16:10 dosubot[bot]

@dosu how to run KoutApiTest on mac

shirleyStorage avatar Oct 21 '24 00:10 shirleyStorage

To run KoutApiTest on a Mac, you need to ensure that your development environment is properly set up. Here are the general steps:

  1. Set Up the Development Environment:

    • Clone the HugeGraph repository:
      git clone https://github.com/apache/hugegraph.git
      
    • Follow the setup instructions for HugeGraph on macOS, which include configuring the database backend and setting up the server. You can find detailed steps here [1].
  2. Ensure Dependencies are Installed:

    • Make sure you have Java and Maven installed, as they are typically required for building and running tests in Java projects.
  3. Run the Test:

    • Navigate to the directory containing the KoutApiTest:
      cd hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/api/traversers
      
    • Use Maven to run the test:
      mvn test -Dtest=KoutApiTest
      

These steps should help you run the KoutApiTest on your Mac. If you encounter any issues, ensure that all dependencies are correctly installed and that your environment is configured as per the HugeGraph setup guidelines.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Oct 21 '24 00:10 dosubot[bot]

This is the expected behavior as we designed. Can I know in what scenario you need to do this?

javeme avatar Oct 27 '24 12:10 javeme