cardano-graphql icon indicating copy to clipboard operation
cardano-graphql copied to clipboard

Include Graphql-Hasura Views / Data in snapshots

Open stefanofranz opened this issue 3 years ago • 6 comments

Currently dbsync provides snapshots to speed up database rebuilds, it seems these snapshots do not include the views required by hasura and graphql components.

Would it be possible to modify the build pipeline that is generating these snapshots to include the data required by graphql? It would massively speedup restore after upgrades.

stefanofranz avatar Jan 25 '22 16:01 stefanofranz

it has been rebuilding the hasura views for quite some time now (about 6hours)

stefano@DESKTOP-9JLK7T0:~$ date
Tue Jan 25 18:07:43 UTC 2022
stefano@DESKTOP-9JLK7T0:~$ kubectl -n cardano logs cardano-6f95d7665c-l8swp -c graphql -f
{"name":"cardano-graphql","hostname":"cardano-6f95d7665c-l8swp","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2022-01-25T12:48:32.406Z","v":0}
{"name":"cardano-graphql","hostname":"cardano-6f95d7665c-l8swp","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2022-01-25T12:48:32.758Z","v":0}
{"name":"cardano-graphql","hostname":"cardano-6f95d7665c-l8swp","pid":1,"level":30,"module":"HasuraClient","msg":"Initialized","time":"2022-01-25T12:55:13.205Z","v":0}
{"name":"cardano-graphql","hostname":"cardano-6f95d7665c-l8swp","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initializing. This can take a few minutes...","time":"2022-01-25T12:55:13.206Z","v":0}

stefanofranz avatar Jan 25 '22 18:01 stefanofranz

As the main dev on db-sync I know NOTHING about any tables that are not created by db-sync.

@rhyslbw @jbgi ?

erikd avatar Jan 26 '22 05:01 erikd

@rhyslbw @jbgi any input on this? This is a pretty significant issue, as without these additional pieces of data in the snapshots - they are effectively useless for upgrades / restores - whilst being used with the standard cardano stack, and would require users to write custom sql queries instead ...

stefanofranz avatar Jan 31 '22 09:01 stefanofranz

The db-sync snapshots are meant to be independent of cardano-graphql version, which is why graphql tables are not included.

jbgi avatar Feb 07 '22 10:02 jbgi

Transferred the issue to https://github.com/input-output-hk/cardano-graphql

@rhyslbw any idea how a graphql tables/views quick restoration could be done in a sane way?

jbgi avatar Feb 07 '22 11:02 jbgi

@jbgi it's just the Asset table. Views can be ignored since they're managed by cardano-graphql on startup.

rhyslbw avatar Jul 06 '22 08:07 rhyslbw