graphjin icon indicating copy to clipboard operation
graphjin copied to clipboard

Wrongly detect schema change when using TimeScaleDB instead of Postgres

Open diegosz opened this issue 4 years ago • 3 comments

There is no priority in this issue, think is enough to know that this happens.

What version of GraphJin are you using?

v0.17.6

Steps to reproduce the issue (config used to run GraphJin).

Instead of Postgres, use TimeScaleDB (for example with the docker image timescale/timescaledb-postgis:1.7.4-pg11)

Expected behaviour and actual result.

It keeps detecting schema change, but in reality there was no schema change.

It's probable that the dbinfo hash computed in core/internal/sdata/tables.go is peeking some internal TimeScaleDB tables so it wrongly thinks that there was an schema change.

diegosz avatar Oct 17 '21 23:10 diegosz

I'll do some tests to see what the bug here could be. As in what changes with timescale db.

dosco avatar Oct 19 '21 07:10 dosco

many thanks, no priority

diegosz avatar Oct 21 '21 14:10 diegosz

FYI The same is happening with postgres which uses postgis. Another issue is that the introspection schema has 10 times more fields than in reality. I am planning on fixing it somehow soon, might submit PR.

pbrazdil avatar Nov 03 '21 09:11 pbrazdil

FYI The same is happening with postgres which uses postgis. Another issue is that the introspection schema has 10 times more fields than in reality. I am planning on fixing it somehow soon, might submit PR.

Happy to help merge any PR that you might have for this, looks like valuable fix.

dosco avatar Oct 01 '22 17:10 dosco

feel free to reopen if this issue still exists.

dosco avatar Dec 15 '22 08:12 dosco

@dosco is timescale db suppported ?

thos is the only reference to it I could find in the project.

gedw99 avatar Jan 21 '23 10:01 gedw99

Its not in my official integrstion testing list but from this thread it seems its supported. @diegosz do you know what internal timescale db tables i can exclude from the discovery query to fix this?

dosco avatar Jan 22 '23 01:01 dosco

@pbrazdil your issue with the introspection should we fixed we re-wrote the whole subsystem.

dosco avatar Jan 22 '23 01:01 dosco

@dosco I'm getting this introspection error with the latest graphjin docker image and timescaledb:

{
  "errors": [
    {
      "message": "Introspection result missing inputFields: { kind: \"INPUT_OBJECT\", name: \"get_git_commitget_git_commitArgsInput\", description: \"\", fields: null, inputFields: null, enumValues: null, interfaces: null, possibleTypes: null }.",
      "stack": "6998/O/r</<@http://localhost:8080/static/js/main.cc6d88da.js:2:2684\n6998/O/r</<@http://localhost:8080/static/js/main.cc6d88da.js:2:2854\n6998/O/r<@http://localhost:8080/static/js/main.cc6d88da.js:2:3053\ni@http://localhost:8080/static/js/main.cc6d88da.js:2:575297\n... ..."
    }
  ]
}

In the schema output the referenced type looks like this:

type get_git_commit @schema(name: _timescaledb_internal) {
  commit_tag:   Text                   
  commit_hash:  Text                   
  commit_time:  TimestampWithTimeZone  
}

type get_git_commit @schema(name: _timescaledb_internal) @function(return_type: record) {
  commit_tag:   Text                     @output
  commit_hash:  Text                     @output
  commit_time:  TimestampWithTimeZone    @output
}

On a somewhat related note functions without named arguments cause schema parsing to fail:

type gtrgm_out @function(return_type: cstring) {
  :  USER    @input
}

Would it be possible to specify entire schemas in the blocklist configuration to ignore? I think it would help with timescale at least, since the internals are all under schemas prefixed with _timescale and the user functions are in public.

zerosym avatar May 16 '23 15:05 zerosym