k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.56k stars 233 forks source link

Compaction not working on Cockroach DB? #87

Open afritzler opened 3 years ago

afritzler commented 3 years ago

I am running a kube-apiserver via kine on top of a CockroachDB. In the kine logs I see a lot of those errors:

time="2021-05-25T13:41:47Z" level=error msg="Compact failed: failed to compact to revision 82: pq: at or near \"where\": syntax error: unimplemented: this syntax"
time="2021-05-25T13:46:47Z" level=error msg="Compact failed: failed to compact to revision 290: pq: at or near \"where\": syntax error: unimplemented: this syntax"
time="2021-05-25T13:51:47Z" level=error msg="Compact failed: failed to compact to revision 498: pq: at or near \"where\": syntax error: unimplemented: this syntax"
time="2021-05-25T13:56:47Z" level=error msg="Compact failed: failed to compact to revision 705: pq: at or near \"where\": syntax error: unimplemented: this syntax"

I am running the latest master build of kine and CockroachDB version V21.1.1. sql.defaults.serial_normalization in my CockroachDB cluster is set to sql_sequence.

brandond commented 3 years ago

Sounds like a new defect with cockroachdb?

afritzler commented 3 years ago

Did somebody manage to run kine stable on cockroachDB? If so what version were you using?

brandond commented 3 years ago

If you search for cockroachdb issues here and on the k3s repo, you should find a few discussions about it. We don't technically support it but a few folks have got it to work.

afritzler commented 3 years ago

Ok it looks like this is the root cause of the compaction not working. https://github.com/cockroachdb/cockroach/issues/40963

afritzler commented 3 years ago

So for me using the compaction query from the sqlite driver did the trick: https://github.com/afritzler/kine/commit/f3130cc9b3cf15a8dc69efc5b877177665012d96

brandond commented 3 years ago

That's interesting, because on some releases of postgres the sqlite query won't execute at all...