-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cached query returns null for newly inserted data #39
Comments
Hey @aarjan! Just to confirm, when you're running the cached query in ReadySet (using the MySQL shell), you're seeing the correct cached query result that reflects the latest write? The issue is just that when the API calls ReadySet, a stale value is returned? |
@alanamarzoev yes, if i use the mysql shell to connect with readyset in the readyset docker container, i can see the newly inserted data returned from that query. |
How are you accessing ReadySet from the API? Are you using a specific ORM/DB client? |
@alanamarzoev I am using Prisma where the host=readyset & port=5433 |
Did you provide |
This is the dsn, |
Would you be able to share the query you're caching? Either here or via email with dan@readyset.io. We could have a bug with executing this particular query. Running the query over the mysql shell could hit a different path in our code, since those queries are run with the query protocol, whereas prisma is likely sending queries using the extended query (prepare/execute) protocol. |
I tried both of these queries in mysql shell from readyset.
|
This query is simple enough that we're probably dealing with an issue of replicating the One way we could end up with a bug like this is if we fail to correctly process a prisma migration. You could try restarting your app against the backing DB, running your migrations, and then adding ReadySet to your application, if possible, without re-running any migrations. If the query works after caching against ReadySet, then we know the bug comes from handling a migration. Also, one way we could verify that we've failed to replicate data is by looking at the graphviz of all cached queries. You can get the graphviz of all queries by running Incidentally, the reason the query works after removing |
Hi @dfwilbanks395,
I tried this but didn't work. Yes, the query works after removing testdb.student because it was fetching from upstream. I have emailed you the graphviz output, hope that helps. |
I connected my node api to the readyset docker service.
A user fetching query was cached in readyset.
But on creating new user, i do not get the new user data from the api.
I could see the new inserted row in both mysql db and in the readyset service through mysql shell.
This is the config for readyset in the docker-compose file which is working in swarm mode:
This is the readyset_docker logs when i fire the api request
The text was updated successfully, but these errors were encountered: