Introducing the pure go driver for sqlite#557
Introducing the pure go driver for sqlite#557viscropst wants to merge 4 commits intok3s-io:masterfrom
Conversation
Okay, I'll trying to do that. |
460d771 to
192c703
Compare
26850ac to
decd7c4
Compare
|
I just realized that our Drone tests have not been running for a while - since CNCF decommissioned our dedicated hardware a month or so ago. I should have a PR merged shortly to move everything over to GHA; you can rebase on top of that and add tests to that. |
Okay, I’ll rebase that later |
a9f2399 to
ea7a215
Compare
|
CI looks good, lint has some complaints about the code though: |
Because of codespaces network latency, the codespaces could not formatting correctly. Now they are all fixed. |
|
Sorry, I pushed another round of changes to CI; would you mind rebasing again? I think we're very close to done with this. |
Don't mind. It's normal for rapid CI migration from dedicated server to github CI. |
|
I am planning to merge the NATS fix PR #549 before this one, so you will likely need to rebase one more time. Would you like to add |
For add |
|
yeah go for it |
6178544 to
8a1bdcf
Compare
Finally I found out the reason of compact conflict for both cgo and nocgo, because of the drivers parse the raw string to url queries to resolving the parameters, so they are not resolved properly. |
brandond
left a comment
There was a problem hiding this comment.
one more question about the checkpoint mode.
I will probably merge this after new years when I will be around to tag a release and fix CI if anything in the release pipeline does not work when tested.
pkg/drivers/sqlite/sqlite_nocgo.go
Outdated
| func New(_ context.Context, _ *sync.WaitGroup, _ *drivers.Config) (bool, server.Backend, error) { | ||
| return false, nil, errNoCgo | ||
| func postCompactSQL() string { | ||
| return `PRAGMA wal_checkpoint(PASSIVE)` |
There was a problem hiding this comment.
Why would we want a passive checkpoint in the pure-go driver, but full in the cgo driver? The point here is to force a checkpoint and sync the WAL. That may not (and likely will not) happen with a passive checkpoint.
b87c6fd to
3ab258f
Compare
|
I just merged another smaller PR that changed the sqlite checkpoint stuff a bit to support litestream. Would you mind rebasing and syncing those changes into both versions of the sqlite driver? |
It's doesn't mind. I'll trying to squash the litestream into both versions. |
d5e3b3b to
ee9a966
Compare
pkg/drivers/sqlite/sqlite.go
Outdated
| if noCheckpoint { | ||
| compactMode = "NOOP" | ||
| } | ||
| return `PRAGMA wal_checkpoint(` + compactMode + `)` |
There was a problem hiding this comment.
- Why are you changing this from FULL to PASSIVE or NOOP?
- Why is the nocgo version missing post-compact checkpoint entirely?
Please restore the checkpoint behavior for both versions.
Introduce the nocgo build to workflow pr
Introduce the nocgo to Dockerfile and build scripts
Fix the `multi-arch-package-nocgo` to use the binary from nocgo build
Introduce the nocgo packge for testing nocgo build
Use the "BIN_SUFFIX" to resolve the variant without cgo in build scripts
Unify the step names for `nocgo` variant
Unify the variable reference usages in `Dockerfile`
Split the sqlite test out of the others
Fix the syntax in pr workflow
Introduce the `nocgo` variant for `Dockerfile.test` building
Change back the job names to `docker` prefixed in pr workflow
Make `docker-nocgo` job load `nocgo` image only
Add back the sqlite test for `docker` job
Introduce `CGO_ENABLED` to `build-api-server-tests`
Introduce the `test` target to `Makefile` for local test
Introduce the `nocgo` variant to release workflow
Fix the missing `-nocgo` tag to `nocgo` variant
Change the built binary name to `kine${BIN_SUFFIX}-${ARCH}`
Signed-off-by: viscropst <viscropst@petalmail.com>
Split the default dsn for nocgo sqlite driver processing Unify the `dataSourceName` to `getDataSourceName` for both cgo enabled and cgo disabled Fix the naming and formatting reported by lint check for sqlite driver Remove the unused `+build cgo` in `sqlite_cgo.go` Unify the `_busy_timeout` processing to mattn's for easier modify the `busy_timeout` Use the `PASSIVE` to checkpoint for nocgo variant to skip the busy invokers Signed-off-by: viscropst <viscropst@petalmail.com>
786ab5d to
16cd8c5
Compare
…`_wal_autocheckpoint` parameter to change checkpoint mode Signed-off-by: viscropst <viscropst@petalmail.com>
Signed-off-by: viscropst <viscropst@petalmail.com>
| key := "_wal_autocheckpoint" | ||
| if params.Has(key) { | ||
| if params.Get(key) == "off" || params.Get(key) == "0" || params.Get(key) == "disable" { | ||
| return 0 | ||
| } | ||
| if i, err := strconv.Atoi(params.Get(key)); err == nil { | ||
| return i | ||
| } | ||
| } | ||
| if params.Has("_kine_disable_wal_autocheckpoint") { | ||
| return 0 | ||
| } |
There was a problem hiding this comment.
- What does the
intreturned by this function indicate? - Why are you replacing the
_kine_disableflag params with_wal_autocheckpointwithout any discussion of this change?
Please stop adding changes that are not related to adding the nocgo sqlite driver. This pull request MUST NOT change anything other than adding the new driver, and tests and artifact publishing for same.
/close #556
and related to k0sproject/k0s#6730.