Can y'all help me understand how `zed relationpshi...
# spicedb
f
Can y'all help me understand how
zed relationpship read
can return fewer relationships than are stored in the DB? I've inserted 1000 relations, but
zed relationship read
is only returning the one relation that was inserted via
zed
and not via code. Wondering if the data could have been mangled somehow, and if so, how to debug.
Copy code
select * from relationship_tuple;
.
.
|  998 | document  | document-8997 | reader   | user              | userA             | ...              |                   5 |                  15 |             | null           |
|  999 | document  | document-8998 | reader   | user              | userA             | ...              |                   5 |                  15 |             | null           |
| 3997 | document  | A             | reader   | user              | B                 | ...              |                  28 | 9223372036854775807 |             | null           |
+------+-----------+---------------+----------+-------------------+-------------------+------------------+---------------------+---------------------+-------------+----------------+
1000 rows in set (0.13 sec)
Copy code
zed relationship read document
document:A reader user:B
the main difference between the row being returned and the other 1000 rows is the
created_transaction | deleted_transaction
j
if
deleted_transaction
is set, then the relationships are deleted
f
yes have double checked that this is all the same instance. And
deleted_transaction
appears to be set for both, you can see it's set to
15
for the 1000 not showing up, and set to
9223372036854775807
for the ones showing up
j
sure
15
means it was deleted
9223372036854775807
(max int) means it was not
f
kk cool thanks
j
so you should be getting back 1 relationship
f
sweet, appreciate that
j
if there is only one with
9223372036854775807
f
when would you expect the deleted rows to be cleaned up? I assume there's a GC process
j
24 hours after deletion
by default
its configurable
f
cool. ty for the help!
53 Views