spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Tooling to help debug cyclic data issues in LookupResources and LookupSubjects

Open zxlin opened this issue 1 year ago • 2 comments

Problem Statement

Sometimes there may be cyclic data accidentally stored into SpiceDB and right now it's kind of hard to identify where in the data there is a cycle. It's only really realized with calls like lookup-resources as that will do a full traversal and not short circuit like with check permission.

Solution Brainstorm

It may be useful to include in the --explain feature some kind of highlighting if a particular node in the graph was traversed more than once (or however many time it was traversed), so that the user can more quickly identify a cyclic data problem in their DB.

zxlin avatar Sep 05 '24 04:09 zxlin

zed --explain does indeed highlight recursions: https://authzed.com/docs/spicedb/modeling/recursion-and-max-depth#what-do-i-do-about-a-max-depth-error-on-checkpermission

josephschorr avatar Sep 05 '24 04:09 josephschorr

@josephschorr, sure, but that doesn't solve the problem statement. If a lookup-resources request results in a cycle, it can be challenging to identify where in the data the cycle is occurring. There is no equivalent of --explain for lookup-resources.

corkrean avatar Sep 20 '24 21:09 corkrean