-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
com.arcadedb.graph.ImmutableVertex cannot be cast to class com.arcadedb.graph.Edge when trying to remove whole DB #1476
Comments
Reproduced, thanks for the database! |
I see the RID inside the edge list contain vertices instead of edges. How this database was populated? Did you import it from another database? |
Thanks for the quick answer, Tbh i'm just doing the admin sys role here, while i wrote the python rest driver she's using, I didn't toy with the ArcadeDB myself. The database was created only using cypher requests. I'll ask my coworker tomorrow (it's 19:44 here), is it possible that what you're talking about is an human error on her side, like the way she populated the database ? Or could it be caused by some other bug ? |
It could be possible that the Cypher API have an issue and are creating edges in the wrong way. |
I'll be honest, she's a junior, so it's possible she did something wrong. I'll add a log in our driver so we can keep a track of the requests. |
I have the confirmation from her that she created nodes exactly this way in Neo4J and she never had issue with it. |
Is there a way I can reproduce this error? I want to test it against the latest 24.2.1. Thanks in advance. |
You mean like a code that could produce the same db ? I’m not allowed to share it. nothing too specific but my coworker was probably creating edges and nodes and multiple short requests, very low milisec delay between then. I am out of office in lapland for 7days, sorry for delay |
I gave a try with fuzzing, creating a lot of nodes and edges. Which cannot reproduce the bug. What we'll do is we will logs all commands sent to the rest api and try to reproduce it with that |
FINALLY ! @lvca Here are two files to reproduce the error. You'll need to edit the python file to set the correct IP and EMPTY database name. you might need to install python and do login for database is set to root:rootroot in script do not hesitate to get back to me if you meet any difficulty while trying to run this script. import json
import requests
db_name = "bugPierre42"
file_history = "logs_final.txt"
import requests
import json
headers = {"Content-Type": "application/json"}
url = "http://192.168.25.25:2480/api/v1/query/"+db_name
def subhandler(response: requests.Response, return_headers: bool=False):
if response.status_code >= 400 :
print(response.text)
json_decoded_data = response.json()
exc = json_decoded_data["exception"] if "detail" not in json_decoded_data else json_decoded_data["detail"]
raise ValueError(exc)
response.raise_for_status()
if return_headers is False:
if len(response.text) > 0:
try:
return response.json()["result"]
except:
return response.text
else:
return
else:
return response.headers
def send_request(payload):
response = requests.post(
url,
data=json.dumps(payload),
auth=('root', 'rootroot'),
)
return subhandler(response, return_headers=False)
def parse_request(line):
start_payload = 10
end_payload = line.find("=>")
payload = line[start_payload:end_payload]
payload_obj = json.loads(payload)
returned_data = line[end_payload+3:]
returned_data_obj = json.loads(returned_data)
return payload_obj, returned_data_obj
lines_db = []
with open(file_history, "r") as file:
lines = file.readlines()
for line in lines:
payload_obj, old_returned_data_obj = parse_request(line)
lines_db.append((payload_obj, old_returned_data_obj))
for payload_obj, old_returned_data_obj in lines_db:
real_now_returned_data = send_request(payload_obj)
if len(real_now_returned_data) != len(old_returned_data_obj):
print("Error in the data, len mismatch")
print(payload_obj)
print(old_returned_data_obj)
print(real_now_returned_data)
break The script will open logs_final.txt and run all the cypher command in the same order. On our server, the created RIDs from a run to another are the same, I hope it will be the same on your end. |
@ExtReMLapin thanks for the test case. I was able to reproduce the issue. |
Hooray ! |
OK, seems there is nothing wrong with the insertion or the database itself. Not even with Cypher. The issue is with the delete: while the vertices/edges are deleted, the iterator points to the wrong link (containing the connected vertex instead of the edge). Working on it. |
Thanks so much for the test case. I was able to isolate the issue and fix it. The deletion of vertices now postpones to the end the deletion of the edges, so no concurrency anymore during the deletion of connected vertices in the same transaction. |
Hello,
ArcadeDB Version:
Latest release 24.1.1
OS and JDK Version:
Tried on both windows and ubuntu
Running on Windows 10 10.0 - Java HotSpot(TM) 64-Bit Server VM 21.0.1
Expected behavior
whole db to be wiped
Actual behavior
Steps to reproduce
db_test.zip
download db linked in message, and run
match (n) detach delete n
cypher command on DBIt's my coworker that has this issue, she claims she's been running this command for ages and it's only now that it started being a problem.
The text was updated successfully, but these errors were encountered: