Skip to content
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

Gemini generates unexpected values for the columns #431

Open
CodeLieutenant opened this issue Oct 2, 2024 · 3 comments
Open

Gemini generates unexpected values for the columns #431

CodeLieutenant opened this issue Oct 2, 2024 · 3 comments
Assignees
Labels
bug Something isn't working crash
Milestone

Comments

@CodeLieutenant
Copy link
Contributor

CodeLieutenant commented Oct 2, 2024

  • Crashed during the serialization into PrettyCQL
    panic: unexpected varint value [int8]-73
goroutine 31 [running]:
github.com/scylladb/gemini/pkg/typedef.SimpleType.CQLPretty({0x1188397, 0x6}, {0x1072ca0, 0x169d358})
        /gemini/pkg/typedef/simple_type.go:111 +0x1daa
github.com/scylladb/gemini/pkg/typedef.prettyCQL({0xc00003e180, 0xba}, {0xc0001b23c0, 0x1e, 0x1e}, {0xc000266140, 0x13, 0x13})
        /gemini/pkg/typedef/typedef.go:260 +0x638
github.com/scylladb/gemini/pkg/typedef.(*Stmt).PrettyCQL(0xc0002763c0)
        /gemini/pkg/typedef/typedef.go:99 +0x1b5
github.com/scylladb/gemini/pkg/stmtlogger.(*fileLogger).committer(0xc0002ad380)
        /gemini/pkg/stmtlogger/filelogger.go:93 +0x172
created by github.com/scylladb/gemini/pkg/stmtlogger.NewFileLogger in goroutine 1
        /gemini/pkg/stmtlogger/filelogger.go:139 +0x316

  • Executes till the end but the Query should be executed (but somehow is)
    QUERY:
SELECT * FROM ks1.table1 WHERE pk0 IN ([-24201]) AND pk1 IN (700471893039039.692) AND pk2 IN (-74) AND pk3 IN ('e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96dac54d987e5a54e9520cb01da7dc8e96d')

Column Types: pk0 = DECIMAL, pk1 = TinyINT, pk2 = TEXT, pk3 = ACII
Values provided in the query are completely wrong

  • When running gemini with features=normal, this activates checking of materialized-views and indexes. There is an issue when validating materialized-views rows against oracle (that's a bug), but the gemini crashes when it tries to print the resulting CQL query with a missing field access.
{"L":"INFO","T":"2024-08-27T12:08:11.574Z","N":"work cycle.validation_job","M":"starting validation loop"}
{"L":"INFO","T":"2024-08-27T12:08:12.353Z","N":"work cycle.validation_job","M":"Validation failed. Error: unable to load check data from the oracle store: gocql: expected 4 values send got 5"}
{"L":"INFO","T":"2024-08-27T12:08:12.354Z","N":"work cycle.validation_job","M":"ending validation loop"}

The current suggestion (as discussed with @fruch) is to disable materialized-views with a CLI flag and make gemini usable (done in #424), but this should be tackled differently (probably rewrite of the materialized views code in gemini)

@CodeLieutenant
Copy link
Contributor Author

CodeLieutenant commented Oct 2, 2024

Testing if the driver is behaving correctly https://github.com/CodeLieutenant/gemini-driver-test

Gemini Seed: 60

Output:

go run main.go -hosts " 192.168.101.2,  192.168.101.3"
2024/10/02 15:07:55 Connected to ScyllaDB:      192.168.101.2,  192.168.101.3
2024/10/02 15:07:55 Creating Keyspace: CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1}
2024/10/02 15:07:55 Creating Schema: [query statement="create table test.table1\n(\n    pk0  timeuuid,\n    pk1  date,\n    ck0  float,\n    ck1  ascii,\n    col0 inet,\n    col1 frozen<list<timeuuid>>,\n    col2 text,\n    col3 date,\n    col4 frozen<set<time>>,\n    col5 double,\n    col6 blob,\n    col7 text,\n    primary key ((pk0, pk1), ck0, ck1)\n) with caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'} and compaction = {'class': 'SizeTieredCompactionStrategy'}\n   and compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}\n   and speculative_retry = '99.0PERCENTILE';\n" values=[] consistency=LOCAL_QUORUM]
2024/10/02 15:07:56 Query: 

SELECT * FROM test.table1 WHERE pk0 IN (?,?) AND pk1 IN (?,?)
2024/10/02 15:07:59 Failed to execute query with prepared statement: invalid UUID "[b573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe9093461]"
Failed to Execute Query table
main.withPreparedStatement
        /golang-driver-test/main.go:127
main.main
        /golang-driver-test/main.go:213
runtime.main
        /go/src/runtime/proc.go:272
runtime.goexit
        /go/src/runtime/asm_amd64.s:1700
2024/10/02 15:07:59 Query: SELECT * FROM test.table1 WHERE pk0 IN ('[b573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe9093461]','[5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe2568226e19f5b163b293932ba3c2c4fe]') AND pk1 IN (82aa8b9e-5c3b-1d6b-b5e6-fc5cee71c66c,4a5194b1-4bd4-1b14-9a6a-fc5cee71c66c)
2024/10/02 15:08:03 Failed to execute query without prepared statement: Invalid list literal for in(pk0): value '[b573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe90934618df4bb22a8ec7deb573537bbe9093461]' is not of type timeuuid
Failed to Execute Query table
main.withoutPreparedStatement
        /golang-driver-test/main.go:93
main.main
        /golang-driver-test/main.go:217
runtime.main
        /go/src/runtime/proc.go:272
runtime.goexit
        /go/src/runtime/asm_amd64.s:1700

Conclusion:
Go Driver works fine, and reports errors correctly.
Gemini Mutation Job also works fine, as values are inserted and no errors are reported.
Problem arises when, gemini is generating data to validate what already in there, it generates
wrong column types for the SELECT.

@fruch
Copy link
Collaborator

fruch commented Dec 2, 2024

@CodeLieutenant

what's the difference between this one and #426

I think one of them should be closed, and collect in one of the information we have so far, and the plans for next steps

@CodeLieutenant
Copy link
Contributor Author

@CodeLieutenant

what's the difference between this one and #426

I think one of them should be closed, and collect in one of the information we have so far, and the plans for next steps

You are right, #420 can be closed, and it's description can be updated here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash
Projects
None yet
Development

No branches or pull requests

2 participants