You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "dehowef (via GitHub)" <gi...@apache.org> on 2023/09/29 22:55:01 UTC

[GitHub] [age] dehowef opened a new issue, #1257: Using a label assigned to another graph will crash the database

dehowef opened a new issue, #1257:
URL: https://github.com/apache/age/issues/1257

   **Describe the bug**
   A clear and concise description of what the bug is.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   - [e.g. JDBC]
   AGE 1.6.0 on PG15
   
   
   **What is the command that caused the error?**
   
   I will explain it via example:
   ```pgsql
   
   create_graph('graph1');
   create_graph('graph2);
   
   create_vlabel('graph1', 'label_exclusive_to_graph1');
   
   SELECT * FROM cypher('graph2', $$CREATE (a:label_exclusive_to_graph1 {name:'a'}),
                               $$) AS (a agtype);
   ```
   When you drop the schemas, this will crash your database.
   
   ```pgsql
   DROP SCHEMA graph2 CASCADE;
   psql:age_install.sql:2: ERROR:  label (relation) cache corrupted
   psql:age_install.sql:2: FATAL:  terminating connection because protocol synchronization was lost
   psql:age_install.sql:2: server closed the connection unexpectedly
       This probably means the server terminated abnormally
       before or while processing the request.
   psql:age_install.sql:2: error: connection to server was lost
   
   ```
   
   **Expected behavior**
   No database crash. Label implementation needs to be reconsidered/fixed
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "dehowef (via GitHub)" <gi...@apache.org>.
dehowef commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1841802476

   Resolved: User Error on my part.
   
   Note, graphs must be dropped via drop_graph(text graph_name, bool cascade) before dropping the AGE Extension and rebuilding to prevent a database crash. Since the CREATE Extension command is a PG command, this care must be taken by AGE users.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1759899780

   @CapnSpek Okay. What have you tried so far other than the above commands?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "CapnSpek (via GitHub)" <gi...@apache.org>.
CapnSpek commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1763398200

   I also tried switching the order of commands such as:
   Creating graph 1 first, then vertex, then graph 2, then vertex.
   Creating graph 1 first, then graph 2, then vertex 1, then vertex 2.
   Both having mixed up labels (graph2 first labels in graph1, and graph1 labels in graph2).
   The database did not crash
   
   @dehowef Can you provide more information about the bug?
   I'm using the master branch age with pg15.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "CapnSpek (via GitHub)" <gi...@apache.org>.
CapnSpek commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1763396324

   So far, I tried setting up the database through the commands mentioned in the issue using both JDBC and Postgres.
   
   Other than that, I tried
   
   Manually creating a vertex with a label for 1 graph, creating vertex using the same label for other graph, then `DROP SCHEMA graph2 CASCADE;`
   That also does not crash the database but only gives an error.
   
   ```
   test=# SELECT * FROM ag_catalog.create_graph('graph1');
   NOTICE:  graph "graph1" has been created
    create_graph 
   --------------
    ```
   
   ```
   test=# SELECT * FROM ag_catalog.create_graph('graph2');
   NOTICE:  graph "graph2" has been created
    create_graph 
   --------------
    
   (1 row)
   ```
   
   ```
   test=# SELECT * FROM cypher('graph1', $$ CREATE (x:Person {name:'X'}) RETURN x $$) AS (x agtype);
                                           x                                       
    
   --------------------------------------------------------------------------------
   -
    {"id": 844424930131969, "label": "Person", "properties": {"name": "X"}}::vertex
   (1 row)
   ```
   
   ```
   test=# SELECT * FROM cypher('graph2', $$ CREATE (x:Person {name:'Y'}) RETURN x $$) AS (x agtype);
                                           x                                       
    
   --------------------------------------------------------------------------------
   -
    {"id": 844424930131969, "label": "Person", "properties": {"name": "Y"}}::vertex
   (1 row)
   ```
   
   ```
   test=# DROP SCHEMA graph2 CASCADE;
   NOTICE:  drop cascades to 4 other objects
   DETAIL:  drop cascades to sequence graph2._label_id_seq
   drop cascades to table graph2._ag_label_vertex
   drop cascades to table graph2._ag_label_edge
   drop cascades to table graph2."Person"
   2023-10-15 16:51:24.432 EEST [160811] ERROR:  table "Person" is for label "Person"
   2023-10-15 16:51:24.432 EEST [160811] STATEMENT:  DROP SCHEMA graph2 CASCADE;
   ERROR:  table "Person" is for label "Person"
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "CapnSpek (via GitHub)" <gi...@apache.org>.
CapnSpek commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1759431400

   I have been unable to reproduce the bug,
   
   Using JDBC I get
   ```
   org.postgresql.util.PSQLException: ERROR: table "Man" is for label "Man"
   	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
   	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
   	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
   	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:335)
   	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:321)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:297)
   	at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:246)
   	at Sample.main(Sample.java:26)
   ```
   
   On AGE I get
   ```
   test=# DROP SCHEMA graph2;
   2023-10-12 14:28:31.405 EEST [83618] ERROR:  cannot drop schema graph2 because other objects depend on it
   2023-10-12 14:28:31.405 EEST [83618] DETAIL:  sequence graph2._label_id_seq depends on schema graph2
   	table graph2._ag_label_vertex depends on schema graph2
   	table graph2._ag_label_edge depends on schema graph2
   	table graph2."Man" depends on schema graph2
   2023-10-12 14:28:31.405 EEST [83618] HINT:  Use DROP ... CASCADE to drop the dependent objects too.
   2023-10-12 14:28:31.405 EEST [83618] STATEMENT:  DROP SCHEMA graph2;
   ERROR:  cannot drop schema graph2 because other objects depend on it
   DETAIL:  sequence graph2._label_id_seq depends on schema graph2
   table graph2._ag_label_vertex depends on schema graph2
   table graph2._ag_label_edge depends on schema graph2
   table graph2."Man" depends on schema graph2
   HINT:  Use DROP ... CASCADE to drop the dependent objects too.
   test=# DROP SCHEMA graph2 CASCADE;
   NOTICE:  drop cascades to 4 other objects
   DETAIL:  drop cascades to sequence graph2._label_id_seq
   drop cascades to table graph2._ag_label_vertex
   drop cascades to table graph2._ag_label_edge
   drop cascades to table graph2."Man"
   2023-10-12 14:28:49.040 EEST [83618] ERROR:  table "Man" is for label "Man"
   2023-10-12 14:28:49.040 EEST [83618] STATEMENT:  DROP SCHEMA graph2 CASCADE;
   ERROR:  table "Man" is for label "Man"
   ```
   
   Using PostgreSQL15.4 on Master branch AGE.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "dehowef (via GitHub)" <gi...@apache.org>.
dehowef closed issue #1257: Using a label assigned to another graph will crash the database
URL: https://github.com/apache/age/issues/1257


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1771889636

   Like @rafsun42 stated, no crash with psql - 
   
   ```
   psql-15.4-5432-pgsql=# drop extension age cascade; create extension age; load 'age'; set search_path TO ag_catalog;
   ERROR:  extension "age" does not exist
   CREATE EXTENSION
   LOAD
   SET
   psql-15.4-5432-pgsql=#
   psql-15.4-5432-pgsql=# select * from create_graph('graph1');
   NOTICE:  graph "graph1" has been created
    create_graph
   --------------
   
   (1 row)
   
   psql-15.4-5432-pgsql=# select * from create_graph('graph2');
   NOTICE:  graph "graph2" has been created
    create_graph
   --------------
   
   (1 row)
   
   psql-15.4-5432-pgsql=#
   psql-15.4-5432-pgsql=# select * from create_vlabel('graph1', 'label_exclusive_to_graph1');
   NOTICE:  VLabel "label_exclusive_to_graph1" has been created
    create_vlabel
   ---------------
   
   (1 row)
   
   psql-15.4-5432-pgsql=# select * from create_vlabel('graph2', 'label_exclusive_to_graph2');
   NOTICE:  VLabel "label_exclusive_to_graph2" has been created
    create_vlabel
   ---------------
   
   (1 row)
   
   psql-15.4-5432-pgsql=#
   psql-15.4-5432-pgsql=# select * from cypher('graph2', $$CREATE (a:label_exclusive_to_graph1 {name:'a'}) $$) as (a agtype);
    a
   ---
   (0 rows)
   
   psql-15.4-5432-pgsql=# select * from cypher('graph1', $$CREATE (a:label_exclusive_to_graph2 {name:'a'}) $$) as (a agtype);
    a
   ---
   (0 rows)
   
   psql-15.4-5432-pgsql=# drop schema graph2 cascade;
   NOTICE:  drop cascades to 5 other objects
   DETAIL:  drop cascades to sequence graph2._label_id_seq
   drop cascades to table graph2._ag_label_vertex
   drop cascades to table graph2._ag_label_edge
   drop cascades to table graph2.label_exclusive_to_graph2
   drop cascades to table graph2.label_exclusive_to_graph1
   ERROR:  table "label_exclusive_to_graph1" is for label "label_exclusive_to_graph1"
   psql-15.4-5432-pgsql=# drop schema graph1 cascade;
   NOTICE:  drop cascades to 5 other objects
   DETAIL:  drop cascades to sequence graph1._label_id_seq
   drop cascades to table graph1._ag_label_vertex
   drop cascades to table graph1._ag_label_edge
   drop cascades to table graph1.label_exclusive_to_graph1
   drop cascades to table graph1.label_exclusive_to_graph2
   ERROR:  table "label_exclusive_to_graph2" is for label "label_exclusive_to_graph2"
   psql-15.4-5432-pgsql=#
   ``` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using a label assigned to another graph will crash the database [age]

Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #1257:
URL: https://github.com/apache/age/issues/1257#issuecomment-1764918082

   @CapnSpek Could you try with JDBC? With PSQL, server does not crash.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org