with mysql, duplicate entries cause failures unlik...
# spicedb
u
with mysql, duplicate entries cause failures unlike with postgres where they are ignored. is this intentional?
v
👋🏻 Hi! Do you mind elaborating? What operation are you performing, and what is your expectation?
u
in the postgres version if i wrote a duplicate relation it would perform the sql equivalent of an "insert ignore". so if it was a duplicate it silently continued whereas now it fails the write operation with:
Error 1062: Duplicate entry 'client-CLIENT_ID-admin-user-USER_ID' for key 'uq_relation_tuple_living'
this occurs on
WriteRelationships
full disclosure, I am using TiDB not vanilla MySQL
v
are you doing
CREATE
or
TOUCH
on that Write RPC?
and further question: are you attempting to write the duplicate: - in 2 write RPCs - as part of one write RPC with multiple tuples, where some are duplicated
u
1. Create, I wan't aware of touch until just now 2. The duplicate exists already. This is a bootstrap script that died half way through last time
v
so esentially you are doing: - write(tupleA) - write(tupleA) instead of: - write(tupleA, tupleA,...) correct?
u
yes. let me try with the touch. I am updating spice for the first time in ~6 months so i don't think touch was a thing last time i worked on it.
v
well, based on your comments, it would seem like there is misalignment between MySQL and PostgreSQL. You are supposed to get an error.
u
touch allows upsert correctly
v
right
u
did touch exist 6mo ago?
v
can you confirm PSQL does not fail with duplicate tuples with`CREATE` ?
u
One sec
CREATE performs an upsert as of 7mo ago, using docker image
730ff726f044
from the quay.io/authzed/spicedb repo.
The spice system hasn't been updated in awhile so atm i cannot confirm on the latest release
v
got it! I appreciate the info 🙇🏻‍♂️ There should be in theory tests to demonstrate
CREATE
fails for all datastores
u
Once I complete the update to v1.8.0 and move to TiDB I will be able to confirm on postgres
v
that'd be awesome, thank you!
we would love to hear your experience with TiDB
u
that could be as early as later today of closer to the end of the week
v
so please let us know!
u
I'm a TiDB fanboy so I'm sure it will be nothing but rainbows and butterflies
v
lol I really hope that's the case 😛 I worked with my team back at GitHub on the MySQL implementation, and I'm aware there is always something slightly different across implementations of the MySQL wire protocol
u
On TiDB or Spice?
v
Actually referring to Vitess
u
Very cool! Idk if you've played with TiDB much but if you get a chance, give it a whirl. It's the most stable system I've ever used. It's self healing capabilities outside of kube are unlike any system I've ever used
v
yeah I had a look at the architecture a while back and it's awesome. Love how's architected to support OLTP and OLAP workloads 😍
3 Views