Jake
05/12/2022, 2:50 PMjzelinskie
05/13/2022, 3:09 AMpatmac_sc
05/14/2022, 1:19 PMJoey
05/14/2022, 5:05 PMjoelt
05/15/2022, 5:07 PMJoey
05/15/2022, 6:25 PMjoelt
05/15/2022, 6:49 PMJoey
05/15/2022, 6:50 PMjoelt
05/15/2022, 8:46 PMJoey
05/15/2022, 11:14 PMJoey
05/15/2022, 11:15 PMJoey
05/15/2022, 11:15 PMSingha1
05/16/2022, 10:38 AMJake
05/16/2022, 1:20 PMbigben
05/16/2022, 2:07 PMgo
type checkResultEntry struct {
response *v1.DispatchCheckResponse
}
type lookupResultEntry struct {
response *v1.DispatchLookupResponse
}
var (
checkResultEntryCost = int64(unsafe.Sizeof(checkResultEntry{}))
lookupResultEntryEmptyCost = int64(unsafe.Sizeof(lookupResultEntry{}))
)
https://github.com/authzed/spicedb/blob/a2e9e40fae53b49a6fb183aa0da338011e1eaba6/internal/dispatch/caching/caching.go#L222
go
cd.c.Set(requestKey, toCache, checkResultEntryCost)
I am new to Go and could be missing something, but I think that the cost passed to the cache for each item ends up being '8', the size of a struct containing a single pointer field. If the cache max cost is meant to be in terms of bytes of memory used, then I think this would be wrong because the pointed-to DispatchCheckResponse
could be using much more than 8 bytes of memory. So, a cache that is set to use no more than 16MB of memory, could actually take up whatever memory is used by 2 million DispatchCheckResponse
structs. The cache config code does state that max size is in terms of bytes:
https://github.com/authzed/spicedb/blob/a2e9e40fae53b49a6fb183aa0da338011e1eaba6/pkg/cmd/server/cacheconfig.go#L45-L51
Should the actual memory cost of the checkResultEntry
struct, including referenced memory, be computed to accurately enforce max cost? Thank you!yetitwo
05/16/2022, 5:26 PMbuf
. I've got protoc-gen-clojure
built and on my $PATH, and i've verified that it works by compiling some .proto
files using protoc
. when I try to do buf generate buf.build/authzed/api
with this buf.gen.yaml
file:
yaml
version: v1
plugins:
- name: clojure
out: src
i get Failure: plugin clojure: fork/exec /Users/me/.local/bin/protoc-gen-clojure: exec format error
. any guidance on this one? does buf have a limited subset of supported protoc
plugins?Joey
05/16/2022, 5:28 PMJoey
05/16/2022, 5:28 PMyetitwo
05/16/2022, 5:33 PMJoey
05/16/2022, 5:34 PMyetitwo
05/16/2022, 5:34 PMprotoc
directly from the protofiles in the spicedb repoJoey
05/16/2022, 5:34 PMyetitwo
05/16/2022, 5:34 PMJoey
05/16/2022, 5:34 PMJoey
05/16/2022, 5:35 PMSingha1
05/16/2022, 6:05 PMJake
05/16/2022, 7:05 PMuser
and they wouldn't overlap or be able to communicate at all. The alternative is that you would have a single permissions system which only has one definition for each object type, and each micro-product can read and write to their own little part of the permissions system, but other things could also do permissions checks that cross those boundaries.Singha1
05/16/2022, 7:07 PMJake
05/16/2022, 7:07 PM