its the same format as the normal URI,
# spicedb
j
its the same format as the normal URI, but pointing to the replica
v
yea, i use 1.39.1 I thought I could indicate several replicas ReadReplicaURIs []string I studied the SPICEDB code and saw that he himself knows how to distribute the requests between them
j
1.39.1 won't work; you'll need to use HEAD
v
head = 1.40?
j
no, latest committed
v
I still don't understand how to indicate a few hosts of the database for reading 😦
I found that the only way to pass multiple read-replica hosts is by using multiple CLI flags: --datastore-read-replica-conn-uri "postgres://access:access@localhost:5432/spicedb?sslmode=disable" \ --datastore-read-replica-conn-uri "postgres://access:access@localhost:5433/spicedb?sslmode=disable" However, I couldn't find a way to do the same using environment variables. I tried: SPICEDB_DATASTORE_READ_REPLICA_CONN_URI="postgres://access:access@localhost:5432/spicedb?sslmode=disable,postgres://access:access@localhost:5433/spicedb? but it doesn't work because StringArrayVar does not split values by commas. Is there a correct way to pass multiple replica URIs using ENV variables, or is this only possible via CLI flags?
j
ENV should split by comma, if I recall correctly
command line args you need to specify multiple
v
https://github.com/authzed/spicedb/blob/e5e1d58f279f8849d36454c777f3104e9515d564/pkg/cmd/datastore/datastore.go#L201 // StringArrayVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma. Use a StringSlice for that.
9 Views