Anna-Team / AnnaDB

Developer-first database
Apache License 2.0
56 stars 4 forks source link

Bug: Allow or Somehow Handle Recursion - Potential Data Loss #12

Open amaster507 opened 1 year ago

amaster507 commented 1 year ago

What you did:

collection|person|:insert[
  m{s|name|:s|Foo|},
  m{s|name|:s|Bar|}
]

Let's say these were generated with the ids:

Foo: f35dbd14-65e5-482f-a6e3-82c18b1aaaa7 Bar: b70fd0a3-a780-4b0c-a095-c832b4261809

I then inversely connected them together so that I could see that they were mutual friends

collection|person|:q[get[person|f35dbd14-65e5-482f-a6e3-82c18b1aaaa7|],update[set{value|friends|:v[person|b70fd0a3-a780-4b0c-a095-c832b4261809|]}]]
collection|person|:q[get[person|b70fd0a3-a780-4b0c-a095-c832b4261809|],update[set{value|friends|:v[person|f35dbd14-65e5-482f-a6e3-82c18b1aaaa7|]}]]

The updates were successfully applied, but then I tried to query them:

collection|person|:get[
  person|f35dbd14-65e5-482f-a6e3-82c18b1aaaa7|,
  person|b70fd0a3-a780-4b0c-a095-c832b4261809|
]

What Happened

But this created an error: Fetch recursion error

image

If I didn't know what to update to remove the recursion, I would have no way to research it. I can no longer query these nodes, and I would might as well delete them and start over.

Ideas:

I think loops should be allowable. I was thinking about this, and think the better way to handle it would be depth limiting. And why I think loops would be a good thing is when you get into graphs (looking at your roadmap) you will want to be able to traverse a graph up and down.

amaster507 commented 1 year ago

And fyi, I cannot even delete these nodes now

image