https://authzed.com logo
Can y all help me understand how `zed
f

fierro

04/04/2023, 5:16 PM
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.
|  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)
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

Joey

04/04/2023, 5:20 PM
if
deleted_transaction
is set, then the relationships are deleted
f

fierro

04/04/2023, 5:22 PM
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

Joey

04/04/2023, 5:23 PM
sure
15
means it was deleted
9223372036854775807
(max int) means it was not
f

fierro

04/04/2023, 5:23 PM
kk cool thanks
j

Joey

04/04/2023, 5:23 PM
so you should be getting back 1 relationship
f

fierro

04/04/2023, 5:23 PM
sweet, appreciate that
j

Joey

04/04/2023, 5:23 PM
if there is only one with
9223372036854775807
f

fierro

04/04/2023, 5:24 PM
when would you expect the deleted rows to be cleaned up? I assume there's a GC process
j

Joey

04/04/2023, 5:24 PM
24 hours after deletion
by default
its configurable
f

fierro

04/04/2023, 5:25 PM
cool. ty for the help!