From 2e7bad7d6ba771164c6b5fb3c43637425a216264 Mon Sep 17 00:00:00 2001 From: Free Ekanayaka Date: Wed, 9 Aug 2023 22:52:29 +0100 Subject: [PATCH 1/3] [doc] README: Update branding Point links and docs to cowsql. --- README.md | 71 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 330c23e..292b282 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,25 @@ -go-dqlite [![CI tests](https://github.com/canonical/go-dqlite/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/canonical/go-dqlite/actions/workflows/build-and-test.yml) [![Coverage Status](https://coveralls.io/repos/github/canonical/go-dqlite/badge.svg?branch=master)](https://coveralls.io/github/canonical/go-dqlite?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/canonical/go-dqlite)](https://goreportcard.com/report/github.com/canonical/go-dqlite) [![GoDoc](https://godoc.org/github.com/canonical/go-dqlite?status.svg)](https://godoc.org/github.com/canonical/go-dqlite) +go-cowsql [![CI tests](https://github.com/cowsql/go-cowsql/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/cowsql/go-cowsql/actions/workflows/build-and-test.yml) [![Coverage Status](https://coveralls.io/repos/github/cowsql/go-cowsql/badge.svg?branch=master)](https://coveralls.io/github/cowsql/go-cowsql?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/cowsql/go-cowsql)](https://goreportcard.com/report/github.com/cowsql/go-cowsql) [![GoDoc](https://godoc.org/github.com/cowsql/go-cowsql?status.svg)](https://godoc.org/github.com/cowsql/go-cowsql) ====== -This repository provides the `go-dqlite` Go package, containing bindings for the -[dqlite](https://github.com/canonical/dqlite) C library and a pure-Go -client for the dqlite wire [protocol](https://github.com/canonical/dqlite/blob/master/doc/protocol.md). +This repository provides the `go-cowsql` Go package, containing bindings for the +[CowSQL](https://github.com/cowsql/cowsql) C library and a pure-Go +client for the cowsql wire [protocol](https://github.com/cowsql/cowsql/blob/master/doc/protocol.md). + +Fork of Canonical go-dqlite +--------------------------- + +These bindings are a CowSQL-oriented fork of Canonical's +[go-dqlite](https://github.com/canonical/go-dqlite) ones, which were originally +written by CowSQL's author +[himself](https://github.com/canonical/go-dqlite/commits?author=freeekanayaka) +while working at Canonical. Usage ----- -The best way to understand how to use the ```go-dqlite``` package is probably by +The best way to understand how to use the ```go-cowsql``` package is probably by looking at the source code of the [demo -program](https://github.com/canonical/go-dqlite/blob/master/cmd/dqlite-demo/dqlite-demo.go) and +program](https://github.com/cowsql/go-cowsql/blob/master/cmd/cowsql-demo/cowsql-demo.go) and use it as example. In general your application will use code such as: @@ -39,55 +48,55 @@ if _, err := db.Exec("CREATE TABLE my_table (n INT)"); err != nil Build ----- -In order to use the go-dqlite package in your application, you'll need to have -the [dqlite](https://github.com/canonical/dqlite) C library installed on your +In order to use the go-cowsql package in your application, you'll need to have +the [CowSQL](https://github.com/cowsql/cowsql) C library installed on your system, along with its dependencies. -By default, go-dqlite's `client` module supports storing a cache of the +By default, go-cowsql's `client` module supports storing a cache of the cluster's state in a SQLite database, locally on each cluster member. (This is -not to be confused with any SQLite databases that are managed by dqlite.) In +not to be confused with any SQLite databases that are managed by CowSQL.) In order to do this, it imports https://github.com/mattn/go-sqlite3, and so you can use the `libsqlite3` build tag to control whether go-sqlite3 links to a system libsqlite3 or builds its own. You can also disable support for SQLite -node stores entirely with the `nosqlite3` build tag (unique to go-dqlite). If +node stores entirely with the `nosqlite3` build tag (unique to go-cowsql). If you pass this tag, your application will not link *directly* to libsqlite3 (but -it will still link it *indirectly* via libdqlite, unless you've dropped the -sqlite3.c amalgamation into the dqlite build). +it will still link it *indirectly* via libcowsql, unless you've dropped the +sqlite3.c amalgamation into the CowSQL build). Documentation ------------- -The documentation for this package can be found on [pkg.go.dev](https://pkg.go.dev/github.com/canonical/go-dqlite). +The documentation for this package can be found on [pkg.go.dev](https://pkg.go.dev/github.com/cowsql/go-cowsql). Demo ---- -To see dqlite in action, either install the Debian package from the PPA: +To see CowSQL in action, either install the Debian package from the PPA: ```bash -sudo add-apt-repository -y ppa:dqlite/dev -sudo apt install dqlite-tools libdqlite-dev +sudo add-apt-repository -y ppa:cowsql/master +sudo apt install cowsql libcowsql-dev ``` -or build the dqlite C library and its dependencies from source, as described -[here](https://github.com/canonical/dqlite#build), and then run: +or build the CowSQL C library and its dependencies from source, as described +[here](https://github.com/cowsql/cowsql#build), and then run: ``` -go install -tags libsqlite3 ./cmd/dqlite-demo +go install -tags libsqlite3 ./cmd/cowsql-demo ``` from the top-level directory of this repository. -This builds a demo dqlite application, which exposes a simple key/value store +This builds a demo CowSQL application, which exposes a simple key/value store over an HTTP API. -Once the `dqlite-demo` binary is installed (normally under `~/go/bin` or +Once the `cowsql-demo` binary is installed (normally under `~/go/bin` or `/usr/bin/`), start three nodes of the demo application: ```bash -dqlite-demo --api 127.0.0.1:8001 --db 127.0.0.1:9001 & -dqlite-demo --api 127.0.0.1:8002 --db 127.0.0.1:9002 --join 127.0.0.1:9001 & -dqlite-demo --api 127.0.0.1:8003 --db 127.0.0.1:9003 --join 127.0.0.1:9001 & +cowsql-demo --api 127.0.0.1:8001 --db 127.0.0.1:9001 & +cowsql-demo --api 127.0.0.1:8002 --db 127.0.0.1:9002 --join 127.0.0.1:9001 & +cowsql-demo --api 127.0.0.1:8003 --db 127.0.0.1:9003 --join 127.0.0.1:9001 & ``` The `--api` flag tells the demo program where to expose its HTTP API. @@ -122,21 +131,21 @@ kill -TERM %1; curl http://127.0.0.1:8002/my-key Shell ------ -A basic SQLite-like dqlite shell is available in the `dqlite-tools` package or +A basic SQLite-like CowSQL shell is available in the `cowsql-tools` package or can be built with: ``` -go install -tags libsqlite3 ./cmd/dqlite +go install -tags libsqlite3 ./cmd/cowsql ``` ``` Usage: - dqlite -s [command] [flags] + cowsql -s [command] [flags] ``` -Example usage in the case of the `dqlite-demo` example listed above: +Example usage in the case of the `cowsql-demo` example listed above: ``` -dqlite -s 127.0.0.1:9001 demo +cowsql -s 127.0.0.1:9001 demo -dqlite> SELECT * FROM model; +cowsql> SELECT * FROM model; my-key|my-value ``` From ad656d8d7b6ab318d22b8859039757e9f6374935 Mon Sep 17 00:00:00 2001 From: Free Ekanayaka Date: Wed, 9 Aug 2023 23:14:01 +0100 Subject: [PATCH 2/3] Rebrand code, tests and CI Rebrand to cowsql. --- .github/workflows/build-and-test.yml | 26 +++--- .github/workflows/cla-check.yml | 11 --- .github/workflows/daily-benchmark.yml | 20 ++--- .github/workflows/packages.yml | 51 ----------- .gitignore | 8 +- app/app.go | 56 ++++++------ app/app_test.go | 10 +-- app/dial.go | 2 +- app/example_test.go | 14 +-- app/options.go | 14 +-- app/proxy.go | 2 +- app/roles.go | 2 +- benchmark/benchmark.go | 4 +- benchmark/benchmark_test.go | 6 +- client/client.go | 6 +- client/client_export_test.go | 2 +- client/client_test.go | 16 ++-- client/constants.go | 2 +- client/database_store.go | 2 +- client/dial.go | 2 +- client/leader.go | 2 +- client/leader_test.go | 8 +- client/log.go | 2 +- client/store.go | 10 +-- client/store_test.go | 8 +- .../cowsql-benchmark.go} | 28 +++--- .../cowsql-demo.go} | 16 ++-- cmd/{dqlite/dqlite.go => cowsql/cowsql.go} | 12 +-- config.go | 18 ++-- docs/restore-db.md | 24 ++--- driver/driver.go | 22 ++--- driver/driver_test.go | 20 ++--- driver/integration_test.go | 16 ++-- go.mod | 2 +- internal/bindings/build.go | 8 +- internal/bindings/server.go | 88 +++++++++---------- internal/bindings/server_test.go | 6 +- internal/bindings/sqlite3.go | 2 +- internal/protocol/config.go | 2 +- internal/protocol/connector.go | 12 +-- internal/protocol/connector_test.go | 8 +- internal/protocol/constants.go | 2 +- internal/protocol/errors.go | 2 +- internal/protocol/protocol.go | 8 +- internal/protocol/protocol_test.go | 4 +- internal/protocol/store.go | 4 +- internal/shell/options.go | 10 +-- internal/shell/shell.go | 16 ++-- logging/func_test.go | 2 +- logging/level_test.go | 2 +- node.go | 18 ++-- ...qlite-demo-util.sh => cowsql-demo-util.sh} | 14 +-- test/{dqlite-demo.sh => cowsql-demo.sh} | 4 +- test/recover.sh | 16 ++-- test/roles.sh | 18 ++-- 55 files changed, 314 insertions(+), 376 deletions(-) delete mode 100644 .github/workflows/cla-check.yml delete mode 100644 .github/workflows/packages.yml rename cmd/{dqlite-benchmark/dqlite-benchmark.go => cowsql-benchmark/cowsql-benchmark.go} (86%) rename cmd/{dqlite-demo/dqlite-demo.go => cowsql-demo/cowsql-demo.go} (91%) rename cmd/{dqlite/dqlite.go => cowsql/cowsql.go} (92%) rename test/{dqlite-demo-util.sh => cowsql-demo-util.sh} (80%) rename test/{dqlite-demo.sh => cowsql-demo.sh} (89%) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9c84553..ee08872 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,9 +35,9 @@ jobs: - name: Setup dependencies run: | - sudo add-apt-repository ppa:dqlite/dev -y + sudo add-apt-repository ppa:cowsql/master -y sudo apt update - sudo apt install -y golint libsqlite3-dev libuv1-dev liblz4-dev libraft-dev libdqlite-dev + sudo apt install -y golint libsqlite3-dev libuv1-dev liblz4-dev libraft-dev libcowsql-dev go get github.com/go-playground/overalls - name: Build & Test @@ -48,10 +48,10 @@ jobs: go get -t -tags libsqlite3 ./... go vet -tags libsqlite3 ./... golint - export GO_DQLITE_MULTITHREAD=1 + export GO_COWSQL_MULTITHREAD=1 go test -v -race -coverprofile=coverage.out ./... go test -v -tags nosqlite3 ./... - VERBOSE=1 DISK=${{ matrix.disk }} ./test/dqlite-demo.sh + VERBOSE=1 DISK=${{ matrix.disk }} ./test/cowsql-demo.sh VERBOSE=1 DISK=${{ matrix.disk }} ./test/roles.sh VERBOSE=1 DISK=${{ matrix.disk }} ./test/recover.sh @@ -63,23 +63,23 @@ jobs: - name: Benchmark env: CGO_LDFLAGS_ALLOW: "-Wl,-z,now" - GO_DQLITE_MULTITHREAD: 1 + GO_COWSQL_MULTITHREAD: 1 run: | - go install -tags libsqlite3 github.com/canonical/go-dqlite/cmd/dqlite-benchmark + go install -tags libsqlite3 github.com/cowsql/go-cowsql/cmd/cowsql-benchmark diskmode=$(if [ ${{ matrix.disk }} -eq 1 ]; then echo -n "--disk"; fi) - dqlite-benchmark --db 127.0.0.1:9001 --driver $diskmode --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & + cowsql-benchmark --db 127.0.0.1:9001 --driver $diskmode --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & masterpid=$! - dqlite-benchmark --db 127.0.0.1:9002 $diskmode --join 127.0.0.1:9001 & - dqlite-benchmark --db 127.0.0.1:9003 $diskmode --join 127.0.0.1:9001 & + cowsql-benchmark --db 127.0.0.1:9002 $diskmode --join 127.0.0.1:9001 & + cowsql-benchmark --db 127.0.0.1:9003 $diskmode --join 127.0.0.1:9001 & wait $masterpid echo "Write results:" - head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-exec-* + head -n 5 /tmp/cowsql-benchmark/127.0.0.1:9001/results/0-exec-* echo "" echo "Read results:" - head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-query-* + head -n 5 /tmp/cowsql-benchmark/127.0.0.1:9001/results/0-query-* - uses: actions/upload-artifact@v3 with: - name: dqlite-benchmark-${{ matrix.os }}-${{ matrix.go }} - path: /tmp/dqlite-benchmark/127.0.0.1:9001/results/* + name: cowsql-benchmark-${{ matrix.os }}-${{ matrix.go }} + path: /tmp/cowsql-benchmark/127.0.0.1:9001/results/* diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml deleted file mode 100644 index b49bbeb..0000000 --- a/.github/workflows/cla-check.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Canonical CLA - -on: - - pull_request - -jobs: - cla-check: - runs-on: ubuntu-20.04 - steps: - - name: Check if CLA signed - uses: canonical/has-signed-canonical-cla@v1 diff --git a/.github/workflows/daily-benchmark.yml b/.github/workflows/daily-benchmark.yml index 3d3fe64..825761b 100644 --- a/.github/workflows/daily-benchmark.yml +++ b/.github/workflows/daily-benchmark.yml @@ -23,9 +23,9 @@ jobs: - name: Setup dependencies run: | - sudo add-apt-repository ppa:dqlite/dev -y + sudo add-apt-repository ppa:cowsql/master -y sudo apt update - sudo apt install -y libsqlite3-dev libuv1-dev liblz4-dev libraft-dev libdqlite-dev + sudo apt install -y libsqlite3-dev libuv1-dev liblz4-dev libraft-dev libcowsql-dev - name: Build & Benchmark env: @@ -33,21 +33,21 @@ jobs: GO_DQLITE_MULTITHREAD: 1 run: | go get -t -tags libsqlite3 ./... - go install -tags libsqlite3 github.com/canonical/go-dqlite/cmd/dqlite-benchmark + go install -tags libsqlite3 github.com/cowsql/go-cowsql/cmd/cowsql-benchmark diskmode=$(if [ ${{ matrix.disk }} -eq 1 ]; then echo -n "--disk"; fi) - dqlite-benchmark --db 127.0.0.1:9001 --duration 3600 --driver $diskmode --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & + cowsql-benchmark --db 127.0.0.1:9001 --duration 3600 --driver $diskmode --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & masterpid=$! - dqlite-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 & - dqlite-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 & + cowsql-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 & + cowsql-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 & wait $masterpid echo "Write results:" - head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-exec-* + head -n 5 /tmp/cowsql-benchmark/127.0.0.1:9001/results/0-exec-* echo "" echo "Read results:" - head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-query-* + head -n 5 /tmp/cowsql-benchmark/127.0.0.1:9001/results/0-query-* - uses: actions/upload-artifact@v3 with: - name: dqlite-daily-benchmark - path: /tmp/dqlite-benchmark/127.0.0.1:9001/results/* + name: cowsql-daily-benchmark + path: /tmp/cowsql-benchmark/127.0.0.1:9001/results/* diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml deleted file mode 100644 index e0b73a4..0000000 --- a/.github/workflows/packages.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Build PPA source packages -on: - - push -jobs: - build: - strategy: - fail-fast: false - matrix: - target: - - focal - - jammy - - kinetic - runs-on: ubuntu-20.04 - steps: - - name: Clone the repositories - run: | - git clone https://github.com/canonical/go-dqlite - git clone https://github.com/canonical/dqlite-ppa -b go-dqlite --depth 1 - - - name: Setup dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq debhelper devscripts dh-golang - - - name: Build source package - env: - DEBFULLNAME: "Github Actions" - DEBEMAIL: "noreply@linuxcontainers.org" - TARGET: ${{ matrix.target }} - run: | - cp -R dqlite-ppa/debian go-dqlite/ - cd go-dqlite/ - go mod vendor - VERSION="$(git describe --tags | sed -e "s/^v//" -e "s/-/+git/")" - dch --create \ - --distribution ${TARGET} \ - --package go-dqlite \ - --newversion ${VERSION}~${TARGET}1 \ - "Automatic build from Github" - debuild -S -sa -us -uc -d - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: debian-${{ matrix.target }} - if-no-files-found: error - path: | - *.buildinfo - *.changes - *.dsc - *.tar.* diff --git a/.gitignore b/.gitignore index ce68600..024e54f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .sqlite -cmd/dqlite/dqlite -cmd/dqlite-demo/dqlite-demo -dqlite -dqlite-demo +cmd/cowsql/cowsql +cmd/cowsql-demo/cowsql-demo +cowsql +cowsql-demo profile.coverprofile overalls.coverprofile diff --git a/app/app.go b/app/app.go index d07a46a..96318c8 100644 --- a/app/app.go +++ b/app/app.go @@ -12,10 +12,10 @@ import ( "sync/atomic" "time" - "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/driver" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/driver" + "github.com/cowsql/go-cowsql/internal/protocol" "github.com/pkg/errors" "golang.org/x/sync/semaphore" ) @@ -24,16 +24,16 @@ import ( // https://pkg.go.dev/sync/atomic#AddInt64 var driverIndex int64 -// App is a high-level helper for initializing a typical dqlite-based Go +// App is a high-level helper for initializing a typical cowsql-based Go // application. // -// It takes care of starting a dqlite node and registering a dqlite Go SQL +// It takes care of starting a cowsql node and registering a cowsql Go SQL // driver. type App struct { id uint64 address string dir string - node *dqlite.Node + node *cowsql.Node nodeBindAddress string listener net.Listener tls *tlsSetup @@ -95,9 +95,9 @@ func New(dir string, options ...Option) (app *App, err error) { } } if len(o.Cluster) == 0 { - info.ID = dqlite.BootstrapID + info.ID = cowsql.BootstrapID } else { - info.ID = dqlite.GenerateID(o.Address) + info.ID = cowsql.GenerateID(o.Address) if err := fileWrite(dir, joinFile, []byte{}); err != nil { return nil, err } @@ -123,7 +123,7 @@ func New(dir string, options ...Option) (app *App, err error) { return nil, err } - if info.ID == dqlite.BootstrapID && joinFileExists { + if info.ID == cowsql.BootstrapID && joinFileExists { return nil, fmt.Errorf("bootstrap node can't join a cluster") } @@ -148,7 +148,7 @@ func New(dir string, options ...Option) (app *App, err error) { // either with the node's address (for bootstrap nodes) or with // the given cluster addresses (for joining nodes). nodes := []client.NodeInfo{} - if info.ID == dqlite.BootstrapID { + if info.ID == cowsql.BootstrapID { nodes = append(nodes, client.NodeInfo{Address: info.Address}) } else { if len(o.Cluster) == 0 { @@ -164,20 +164,20 @@ func New(dir string, options ...Option) (app *App, err error) { cleanups = append(cleanups, func() { fileRemove(dir, storeFile) }) } - // Start the local dqlite engine. + // Start the local cowsql engine. ctx, stop := context.WithCancel(context.Background()) var nodeDial client.DialFunc if o.Conn != nil { nodeDial = extDialFuncWithProxy(ctx, o.Conn.dialFunc) } else if o.TLS != nil { - nodeBindAddress = fmt.Sprintf("@dqlite-%d", info.ID) + nodeBindAddress = fmt.Sprintf("@cowsql-%d", info.ID) // Within a snap we need to choose a different name for the abstract unix domain // socket to get it past the AppArmor confinement. // See https://github.com/snapcore/snapd/blob/master/interfaces/apparmor/template.go#L357 snapInstanceName := os.Getenv("SNAP_INSTANCE_NAME") if len(snapInstanceName) > 0 { - nodeBindAddress = fmt.Sprintf("@snap.%s.dqlite-%d", snapInstanceName, info.ID) + nodeBindAddress = fmt.Sprintf("@snap.%s.cowsql-%d", snapInstanceName, info.ID) } nodeDial = makeNodeDialFunc(ctx, o.TLS.Dial) @@ -185,14 +185,14 @@ func New(dir string, options ...Option) (app *App, err error) { nodeBindAddress = info.Address nodeDial = client.DefaultDialFunc } - node, err := dqlite.New( + node, err := cowsql.New( info.ID, info.Address, dir, - dqlite.WithBindAddress(nodeBindAddress), - dqlite.WithDialFunc(nodeDial), - dqlite.WithFailureDomain(o.FailureDomain), - dqlite.WithNetworkLatency(o.NetworkLatency), - dqlite.WithSnapshotParams(o.SnapshotParams), - dqlite.WithDiskMode(o.DiskMode), + cowsql.WithBindAddress(nodeBindAddress), + cowsql.WithDialFunc(nodeDial), + cowsql.WithFailureDomain(o.FailureDomain), + cowsql.WithNetworkLatency(o.NetworkLatency), + cowsql.WithSnapshotParams(o.SnapshotParams), + cowsql.WithDiskMode(o.DiskMode), ) if err != nil { stop() @@ -204,7 +204,7 @@ func New(dir string, options ...Option) (app *App, err error) { } cleanups = append(cleanups, func() { node.Close() }) - // Register the local dqlite driver. + // Register the local cowsql driver. driverDial := client.DefaultDialFunc if o.TLS != nil { driverDial = client.DialFuncWithTLS(driverDial, o.TLS.Dial) @@ -222,7 +222,7 @@ func New(dir string, options ...Option) (app *App, err error) { stop() return nil, fmt.Errorf("create driver: %w", err) } - driverName := fmt.Sprintf("dqlite-%d", atomic.AddInt64(&driverIndex, 1)) + driverName := fmt.Sprintf("cowsql-%d", atomic.AddInt64(&driverIndex, 1)) sql.Register(driverName, driver) if o.Voters < 3 || o.Voters%2 == 0 { @@ -277,7 +277,7 @@ func New(dir string, options ...Option) (app *App, err error) { remote := <-o.Conn.acceptCh // Write the status line and upgrade header by hand since w.WriteHeader() would fail after Hijack(). - data := []byte("HTTP/1.1 101 Switching Protocols\r\nUpgrade: dqlite\r\n\r\n") + data := []byte("HTTP/1.1 101 Switching Protocols\r\nUpgrade: cowsql\r\n\r\n") n, err := remote.Write(data) if err != nil || n != len(data) { remote.Close() @@ -418,17 +418,17 @@ func (a *App) Close() error { return nil } -// ID returns the dqlite ID of this application node. +// ID returns the cowsql ID of this application node. func (a *App) ID() uint64 { return a.id } -// Address returns the dqlite address of this application node. +// Address returns the cowsql address of this application node. func (a *App) Address() string { return a.address } -// Driver returns the name used to register the dqlite driver. +// Driver returns the name used to register the cowsql driver. func (a *App) Driver() string { return a.driverName } @@ -450,7 +450,7 @@ func (a *App) Ready(ctx context.Context) error { } } -// Open the dqlite database with the given name +// Open the cowsql database with the given name func (a *App) Open(ctx context.Context, database string) (*sql.DB, error) { db, err := sql.Open(a.Driver(), database) if err != nil { diff --git a/app/app_test.go b/app/app_test.go index b67937e..b4bbbed 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -18,9 +18,9 @@ import ( "testing" "time" - "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -889,7 +889,7 @@ func TestOptions(t *testing.T) { options := []app.Option{ app.WithAddress("127.0.0.1:9000"), app.WithNetworkLatency(20 * time.Millisecond), - app.WithSnapshotParams(dqlite.SnapshotParams{Threshold: 1024, Trailing: 1024}), + app.WithSnapshotParams(cowsql.SnapshotParams{Threshold: 1024, Trailing: 1024}), app.WithTracing(client.LogDebug), } app, cleanup := newApp(t, options...) @@ -1139,7 +1139,7 @@ var appIndex int func newDir(t *testing.T) (string, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-app-test-") + dir, err := ioutil.TempDir("", "cowsql-app-test-") assert.NoError(t, err) cleanup := func() { diff --git a/app/dial.go b/app/dial.go index 96d536f..32d0f85 100644 --- a/app/dial.go +++ b/app/dial.go @@ -6,7 +6,7 @@ import ( "fmt" "net" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql/client" ) // Like client.DialFuncWithTLS but also starts the proxy, since the raft diff --git a/app/example_test.go b/app/example_test.go index 1d0dd25..231f927 100644 --- a/app/example_test.go +++ b/app/example_test.go @@ -5,18 +5,18 @@ import ( "io/ioutil" "os" - "github.com/canonical/go-dqlite/app" + "github.com/cowsql/go-cowsql/app" ) -// To start the first node of a dqlite cluster for the first time, its network +// To start the first node of a cowsql cluster for the first time, its network // address should be specified using the app.WithAddress() option. // // When the node is restarted a second time, the app.WithAddress() option might // be omitted, since the node address will be persisted in the info.yaml file. // -// The very first node has always the same ID (dqlite.BootstrapID). +// The very first node has always the same ID (cowsql.BootstrapID). func Example() { - dir, err := ioutil.TempDir("", "dqlite-app-example-") + dir, err := ioutil.TempDir("", "cowsql-app-example-") if err != nil { return } @@ -55,19 +55,19 @@ func Example() { // // Each additional node will be automatically assigned a unique ID. func ExampleWithCluster() { - dir1, err := ioutil.TempDir("", "dqlite-app-example-") + dir1, err := ioutil.TempDir("", "cowsql-app-example-") if err != nil { return } defer os.RemoveAll(dir1) - dir2, err := ioutil.TempDir("", "dqlite-app-example-") + dir2, err := ioutil.TempDir("", "cowsql-app-example-") if err != nil { return } defer os.RemoveAll(dir2) - dir3, err := ioutil.TempDir("", "dqlite-app-example-") + dir3, err := ioutil.TempDir("", "cowsql-app-example-") if err != nil { return } diff --git a/app/options.go b/app/options.go index c81113f..326dd85 100644 --- a/app/options.go +++ b/app/options.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" ) // Option can be used to tweak app parameters. @@ -46,7 +46,7 @@ func WithCluster(cluster []string) Option { } // WithExternalConn enables passing an external dial function that will be used -// whenever dqlite needs to make an outside connection. +// whenever cowsql needs to make an outside connection. // // Also takes a net.Conn channel that should be received when the external connection has been accepted. func WithExternalConn(dialFunc client.DialFunc, acceptCh chan net.Conn) Option { @@ -74,7 +74,7 @@ func WithTLS(listen *tls.Config, dial *tls.Config) Option { } } -// WithUnixSocket allows setting a specific socket path for communication between go-dqlite and dqlite. +// WithUnixSocket allows setting a specific socket path for communication between go-cowsql and cowsql. // // The default is an empty string which means a random abstract unix socket. func WithUnixSocket(path string) Option { @@ -172,7 +172,7 @@ func WithNetworkLatency(latency time.Duration) Option { } // WithSnapshotParams sets the raft snapshot parameters. -func WithSnapshotParams(params dqlite.SnapshotParams) Option { +func WithSnapshotParams(params cowsql.SnapshotParams) Option { return func(options *options) { options.SnapshotParams = params } @@ -212,7 +212,7 @@ type options struct { FailureDomain uint64 NetworkLatency time.Duration UnixSocket string - SnapshotParams dqlite.SnapshotParams + SnapshotParams cowsql.SnapshotParams DiskMode bool } @@ -287,6 +287,6 @@ func defaultLogFunc(l client.LogLevel, format string, a ...interface{}) { if l != client.LogError { return } - msg := fmt.Sprintf("["+l.String()+"]"+" dqlite: "+format, a...) + msg := fmt.Sprintf("["+l.String()+"]"+" cowsql: "+format, a...) log.Printf(msg) } diff --git a/app/proxy.go b/app/proxy.go index 48881ee..aa34ebf 100644 --- a/app/proxy.go +++ b/app/proxy.go @@ -162,7 +162,7 @@ func setKeepalive(conn *net.TCPConn) error { // Set TCP_USER_TIMEOUT option to limit the maximum amount of time in ms that transmitted data may remain // unacknowledged before TCP will forcefully close the corresponding connection and return ETIMEDOUT to the // application. This combined with the TCP keepalive options on the socket will ensure that should the - // remote side of the connection disappear abruptly that dqlite will detect this and close the socket quickly. + // remote side of the connection disappear abruptly that cowsql will detect this and close the socket quickly. // Decreasing the user timeouts allows applications to "fail fast" if so desired. Otherwise it may take // up to 20 minutes with the current system defaults in a normal WAN environment if there are packets in // the send queue that will prevent the keepalive timer from working as the retransmission timers kick in. diff --git a/app/roles.go b/app/roles.go index 5b24bdf..bb157ae 100644 --- a/app/roles.go +++ b/app/roles.go @@ -3,7 +3,7 @@ package app import ( "sort" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql/client" ) const minVoters = 3 diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index fd25906..24145ab 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -9,8 +9,8 @@ import ( "path" "time" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/client" ) const ( diff --git a/benchmark/benchmark_test.go b/benchmark/benchmark_test.go index 31b2307..7f6539d 100644 --- a/benchmark/benchmark_test.go +++ b/benchmark/benchmark_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/benchmark" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/benchmark" "github.com/stretchr/testify/require" ) @@ -22,7 +22,7 @@ const ( func bmSetup(t *testing.T, addr string, join []string) (string, *app.App, *sql.DB, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-app-test-") + dir, err := ioutil.TempDir("", "cowsql-app-test-") require.NoError(t, err) app, err := app.New(dir, app.WithAddress(addr), app.WithCluster(join)) diff --git a/client/client.go b/client/client.go index c8809be..60d73a5 100644 --- a/client/client.go +++ b/client/client.go @@ -3,14 +3,14 @@ package client import ( "context" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" "github.com/pkg/errors" ) // DialFunc is a function that can be used to establish a network connection. type DialFunc = protocol.DialFunc -// Client speaks the dqlite wire protocol. +// Client speaks the cowsql wire protocol. type Client struct { protocol *protocol.Protocol } @@ -39,7 +39,7 @@ func WithLogFunc(log LogFunc) Option { } } -// New creates a new client connected to the dqlite node with the given +// New creates a new client connected to the cowsql node with the given // address. func New(ctx context.Context, address string, options ...Option) (*Client, error) { o := defaultOptions() diff --git a/client/client_export_test.go b/client/client_export_test.go index 5fa73b4..cca1f5c 100644 --- a/client/client_export_test.go +++ b/client/client_export_test.go @@ -1,7 +1,7 @@ package client import ( - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) func (c *Client) Protocol() *protocol.Protocol { diff --git a/client/client_test.go b/client/client_test.go index 27ac2e4..ff381cb 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - dqlite "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/internal/protocol" + cowsql "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/internal/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -156,13 +156,13 @@ func TestClient_Describe(t *testing.T) { assert.Equal(t, uint64(123), metadata.Weight) } -func newNode(t *testing.T) (*dqlite.Node, func()) { +func newNode(t *testing.T) (*cowsql.Node, func()) { t.Helper() dir, dirCleanup := newDir(t) id := uint64(1) address := fmt.Sprintf("@%d", id+1000) - node, err := dqlite.New(uint64(1), address, dir, dqlite.WithBindAddress(address)) + node, err := cowsql.New(uint64(1), address, dir, cowsql.WithBindAddress(address)) require.NoError(t, err) err = node.Start() @@ -176,7 +176,7 @@ func newNode(t *testing.T) (*dqlite.Node, func()) { return node, cleanup } -func addNode(t *testing.T, cli *client.Client, id uint64) (*dqlite.Node, func()) { +func addNode(t *testing.T, cli *client.Client, id uint64) (*cowsql.Node, func()) { t.Helper() dir, dirCleanup := newDir(t) @@ -184,7 +184,7 @@ func addNode(t *testing.T, cli *client.Client, id uint64) (*dqlite.Node, func()) defer cancel() address := fmt.Sprintf("@%d", id+1000) - node, err := dqlite.New(id, address, dir, dqlite.WithBindAddress(address)) + node, err := cowsql.New(id, address, dir, cowsql.WithBindAddress(address)) require.NoError(t, err) err = node.Start() @@ -211,7 +211,7 @@ func addNode(t *testing.T, cli *client.Client, id uint64) (*dqlite.Node, func()) func newDir(t *testing.T) (string, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-replication-test-") + dir, err := ioutil.TempDir("", "cowsql-replication-test-") assert.NoError(t, err) cleanup := func() { diff --git a/client/constants.go b/client/constants.go index 2aacfba..cd18b8a 100644 --- a/client/constants.go +++ b/client/constants.go @@ -1,7 +1,7 @@ package client import ( - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) // Node roles diff --git a/client/database_store.go b/client/database_store.go index 665bb02..7717537 100644 --- a/client/database_store.go +++ b/client/database_store.go @@ -19,7 +19,7 @@ type nodeStoreOptions struct { Where string } -// DatabaseNodeStore persists a list addresses of dqlite nodes in a SQL table. +// DatabaseNodeStore persists a list addresses of cowsql nodes in a SQL table. type DatabaseNodeStore struct { db *sql.DB // Database handle to use. schema string // Name of the schema holding the servers table. diff --git a/client/dial.go b/client/dial.go index 5466679..e7710e2 100644 --- a/client/dial.go +++ b/client/dial.go @@ -5,7 +5,7 @@ import ( "crypto/tls" "net" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) // DefaultDialFunc is the default dial function, which can handle plain TCP and diff --git a/client/leader.go b/client/leader.go index 5de72ce..e57f128 100644 --- a/client/leader.go +++ b/client/leader.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) // FindLeader returns a Client connected to the current cluster leader. diff --git a/client/leader_test.go b/client/leader_test.go index f173972..c83f349 100644 --- a/client/leader_test.go +++ b/client/leader_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - dqlite "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" + cowsql "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" "github.com/stretchr/testify/require" ) func TestMembership(t *testing.T) { n := 3 - nodes := make([]*dqlite.Node, n) + nodes := make([]*cowsql.Node, n) infos := make([]client.NodeInfo, n) for i := range nodes { @@ -21,7 +21,7 @@ func TestMembership(t *testing.T) { address := fmt.Sprintf("@test-%d", id) dir, cleanup := newDir(t) defer cleanup() - node, err := dqlite.New(id, address, dir, dqlite.WithBindAddress(address)) + node, err := cowsql.New(id, address, dir, cowsql.WithBindAddress(address)) require.NoError(t, err) nodes[i] = node infos[i].ID = id diff --git a/client/log.go b/client/log.go index 0c4e467..2fb10f2 100644 --- a/client/log.go +++ b/client/log.go @@ -1,7 +1,7 @@ package client import ( - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/logging" ) // LogFunc is a function that can be used for logging. diff --git a/client/store.go b/client/store.go index 6e12646..ed33609 100644 --- a/client/store.go +++ b/client/store.go @@ -9,11 +9,11 @@ import ( "github.com/google/renameio" "gopkg.in/yaml.v2" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) -// NodeStore is used by a dqlite client to get an initial list of candidate -// dqlite nodes that it can dial in order to find a leader dqlite node to use. +// NodeStore is used by a cowsql client to get an initial list of candidate +// cowsql nodes that it can dial in order to find a leader cowsql node to use. type NodeStore = protocol.NodeStore // NodeRole identifies the role of a node. @@ -22,13 +22,13 @@ type NodeRole = protocol.NodeRole // NodeInfo holds information about a single server. type NodeInfo = protocol.NodeInfo -// InmemNodeStore keeps the list of target dqlite nodes in memory. +// InmemNodeStore keeps the list of target cowsql nodes in memory. type InmemNodeStore = protocol.InmemNodeStore // NewInmemNodeStore creates NodeStore which stores its data in-memory. var NewInmemNodeStore = protocol.NewInmemNodeStore -// Persists a list addresses of dqlite nodes in a YAML file. +// Persists a list addresses of cowsql nodes in a YAML file. type YamlNodeStore struct { path string servers []NodeInfo diff --git a/client/store_test.go b/client/store_test.go index 61ee95e..304cc40 100644 --- a/client/store_test.go +++ b/client/store_test.go @@ -7,9 +7,9 @@ import ( "database/sql" "testing" - dqlite "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/driver" + cowsql "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/driver" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -63,7 +63,7 @@ func TestConfigMultiThread(t *testing.T) { cleanup := dummyDBSetup(t) defer cleanup() - err := dqlite.ConfigMultiThread() + err := cowsql.ConfigMultiThread() assert.EqualError(t, err, "SQLite is already initialized") } diff --git a/cmd/dqlite-benchmark/dqlite-benchmark.go b/cmd/cowsql-benchmark/cowsql-benchmark.go similarity index 86% rename from cmd/dqlite-benchmark/dqlite-benchmark.go rename to cmd/cowsql-benchmark/cowsql-benchmark.go index 5e9ebaf..2609fdb 100644 --- a/cmd/dqlite-benchmark/dqlite-benchmark.go +++ b/cmd/cowsql-benchmark/cowsql-benchmark.go @@ -8,8 +8,8 @@ import ( "path/filepath" "time" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/benchmark" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/benchmark" "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/sys/unix" @@ -17,7 +17,7 @@ import ( const ( defaultClusterTimeout = 120 - defaultDir = "/tmp/dqlite-benchmark" + defaultDir = "/tmp/cowsql-benchmark" defaultDiskMode = false defaultDriver = false defaultDurationS = 60 @@ -25,19 +25,19 @@ const ( defaultKvValueSize = 1024 defaultWorkers = 1 defaultWorkload = "kvwrite" - docString = "For benchmarking dqlite.\n\n" + + docString = "For benchmarking cowsql.\n\n" + "Run a 1 node benchmark:\n" + - "dqlite-benchmark -d 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001\n\n" + + "cowsql-benchmark -d 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001\n\n" + "Run a multi-node benchmark, the first node will self-elect and become leader,\n" + "the driver flag results in the workload being run from the first, leader node.\n" + - "dqlite-benchmark --db 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 &\n" + - "dqlite-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 &\n" + - "dqlite-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 &\n\n" + + "cowsql-benchmark --db 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 &\n" + + "cowsql-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 &\n" + + "cowsql-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 &\n\n" + "Run a multi-node benchmark, the first node will self-elect and become leader,\n" + "the driver flag results in the workload being run from the third, non-leader node.\n" + - "dqlite-benchmark --db 127.0.0.1:9001 &\n" + - "dqlite-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 &\n" + - "dqlite-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 &\n\n" + + "cowsql-benchmark --db 127.0.0.1:9001 &\n" + + "cowsql-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 &\n" + + "cowsql-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 &\n\n" + "The results can be found on the `driver` node in " + defaultDir + "/results or in the directory provided to the tool.\n" + "Benchmark results are files named `n-q-timestamp` where `n` is the number of the worker,\n" + "`q` is the type of query that was tracked. All results in the file are in milliseconds.\n" @@ -67,8 +67,8 @@ func main() { var diskMode bool cmd := &cobra.Command{ - Use: "dqlite-benchmark", - Short: "For benchmarking dqlite", + Use: "cowsql-benchmark", + Short: "For benchmarking cowsql", Long: docString, RunE: func(cmd *cobra.Command, args []string) error { dir := filepath.Join(dir, db) @@ -146,7 +146,7 @@ func main() { flags.IntVar(&workers, "workers", defaultWorkers, "Number of workers executing the workload.") flags.IntVar(&kvKeySize, "key-size", defaultKvKeySize, "Size of the KV keys in bytes.") flags.IntVar(&kvValueSize, "value-size", defaultKvValueSize, "Size of the KV values in bytes.") - flags.BoolVar(&diskMode, "disk", defaultDiskMode, "Warning: Unstable, Experimental. Set this flag to enable dqlite's disk-mode.") + flags.BoolVar(&diskMode, "disk", defaultDiskMode, "Warning: Unstable, Experimental. Set this flag to enable cowsql's disk-mode.") cmd.MarkFlagRequired("db") if err := cmd.Execute(); err != nil { diff --git a/cmd/dqlite-demo/dqlite-demo.go b/cmd/cowsql-demo/cowsql-demo.go similarity index 91% rename from cmd/dqlite-demo/dqlite-demo.go rename to cmd/cowsql-demo/cowsql-demo.go index 940ee58..f19cd68 100644 --- a/cmd/dqlite-demo/dqlite-demo.go +++ b/cmd/cowsql-demo/cowsql-demo.go @@ -14,8 +14,8 @@ import ( "path/filepath" "strings" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/client" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/client" "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/sys/unix" @@ -32,11 +32,11 @@ func main() { var key string cmd := &cobra.Command{ - Use: "dqlite-demo", - Short: "Demo application using dqlite", - Long: `This demo shows how to integrate a Go application with dqlite. + Use: "cowsql-demo", + Short: "Demo application using cowsql", + Long: `This demo shows how to integrate a Go application with cowsql. -Complete documentation is available at https://github.com/canonical/go-dqlite`, +Complete documentation is available at https://github.com/cowsql/go-cowsql`, RunE: func(cmd *cobra.Command, args []string) error { dir := filepath.Join(dir, db) if err := os.MkdirAll(dir, 0755); err != nil { @@ -142,9 +142,9 @@ Complete documentation is available at https://github.com/canonical/go-dqlite`, flags.StringVarP(&api, "api", "a", "", "address used to expose the demo API") flags.StringVarP(&db, "db", "d", "", "address used for internal database replication") join = flags.StringSliceP("join", "j", nil, "database addresses of existing nodes") - flags.StringVarP(&dir, "dir", "D", "/tmp/dqlite-demo", "data directory") + flags.StringVarP(&dir, "dir", "D", "/tmp/cowsql-demo", "data directory") flags.BoolVarP(&verbose, "verbose", "v", false, "verbose logging") - flags.BoolVar(&diskMode, "disk", defaultDiskMode, "Warning: Unstable, Experimental. Set this flag to enable dqlite's disk-mode.") + flags.BoolVar(&diskMode, "disk", defaultDiskMode, "Warning: Unstable, Experimental. Set this flag to enable cowsql's disk-mode.") flags.StringVarP(&crt, "cert", "c", "", "public TLS cert") flags.StringVarP(&key, "key", "k", "", "private TLS key") diff --git a/cmd/dqlite/dqlite.go b/cmd/cowsql/cowsql.go similarity index 92% rename from cmd/dqlite/dqlite.go rename to cmd/cowsql/cowsql.go index 83282af..62fb366 100644 --- a/cmd/dqlite/dqlite.go +++ b/cmd/cowsql/cowsql.go @@ -10,9 +10,9 @@ import ( "os" "strings" - "github.com/canonical/go-dqlite/app" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/internal/shell" + "github.com/cowsql/go-cowsql/app" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/internal/shell" "github.com/peterh/liner" "github.com/spf13/cobra" ) @@ -24,8 +24,8 @@ func main() { var format string cmd := &cobra.Command{ - Use: "dqlite -s [command]", - Short: "Standard dqlite shell", + Use: "cowsql -s [command]", + Short: "Standard cowsql shell", Args: cobra.RangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error { if len(*servers) == 0 { @@ -105,7 +105,7 @@ func main() { defer line.Close() for { - input, err := line.Prompt("dqlite> ") + input, err := line.Prompt("cowsql> ") if err != nil { if err == io.EOF { break diff --git a/config.go b/config.go index c98d775..2d3b687 100644 --- a/config.go +++ b/config.go @@ -1,20 +1,20 @@ // +build !nosqlite3 -package dqlite +package cowsql import ( "fmt" "os" - "github.com/canonical/go-dqlite/internal/bindings" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/bindings" + "github.com/cowsql/go-cowsql/internal/protocol" "github.com/pkg/errors" ) // ConfigMultiThread sets the threading mode of SQLite to Multi-thread. // -// By default go-dqlite configures SQLite to Single-thread mode, because the -// dqlite engine itself is single-threaded, and enabling Multi-thread or +// By default go-cowsql configures SQLite to Single-thread mode, because the +// cowsql engine itself is single-threaded, and enabling Multi-thread or // Serialized modes would incur in a performance penality. // // If your Go process also uses SQLite directly (e.g. using the @@ -24,8 +24,8 @@ import ( // IMPORTANT: It's possible to successfully change SQLite's threading mode only // if no SQLite APIs have been invoked yet (e.g. no database has been opened // yet). Therefore you'll typically want to call ConfigMultiThread() very early -// in your process setup. Alternatively you can set the GO_DQLITE_MULTITHREAD -// environment variable to 1 at process startup, in order to prevent go-dqlite +// in your process setup. Alternatively you can set the GO_COWSQL_MULTITHREAD +// environment variable to 1 at process startup, in order to prevent go-cowsql // from setting Single-thread mode at all. func ConfigMultiThread() error { if err := bindings.ConfigMultiThread(); err != nil { @@ -38,9 +38,9 @@ func ConfigMultiThread() error { } func init() { - // Don't enable single thread mode by default if GO_DQLITE_MULTITHREAD + // Don't enable single thread mode by default if GO_COWSQL_MULTITHREAD // is set. - if os.Getenv("GO_DQLITE_MULTITHREAD") == "1" { + if os.Getenv("GO_COWSQL_MULTITHREAD") == "1" { return } err := bindings.ConfigSingleThread() diff --git a/docs/restore-db.md b/docs/restore-db.md index 36f5fbd..81744aa 100644 --- a/docs/restore-db.md +++ b/docs/restore-db.md @@ -3,7 +3,7 @@ Note this document is not complete and work in progress. # A. INFO **Always backup your database folders before performing any of the steps -described below and make sure no dqlite nodes are running!** +described below and make sure no cowsql nodes are running!** ## A.1 cluster.yaml @@ -61,7 +61,7 @@ cat < "cluster.yaml" Role: 0 EOF ``` -3. For every node, run `dqlite -s ".reconfigure +3. For every node, run `cowsql -s ".reconfigure "` The `DbAddress`, `DbName` aren't really important, just use something syntactically correct, we are more interested in the side effects of this @@ -78,7 +78,7 @@ command will be added in the future. # B. Restoring Data -## B.1 Loading existing data and existing network/node configuration in `dqlite-demo` +## B.1 Loading existing data and existing network/node configuration in `cowsql-demo` *Use this when you have access to the machines where the database lives and want to start the database with the unaltered data of every node.* @@ -89,7 +89,7 @@ to start the database with the unaltered data of every node.* the `DataDirectory`. 2. For every node in `cluster.yaml`, create a directory with name equal to `DbAddress` under the `DataDirectory`, unique to the node, this `host:port` - will be needed later on for the `--db` argument when you start the `dqlite-demo` + will be needed later on for the `--db` argument when you start the `cowsql-demo` application, e.g. for node 1 you now have a directory `data/127.0.0.1:9001`. We will refer to this as the `NodeDirectory`. 3. For every node in `cluster.yaml`, copy all the data for that node to @@ -97,17 +97,17 @@ to start the database with the unaltered data of every node.* 4. For every node in `cluster.yaml`, make sure there exists an `info.yaml` in `NodeDirectory` that contains the information as found in `cluster.yaml`. 5. For every node in `cluster.yaml`, run: - `dqlite-demo --dir --api --db `, + `cowsql-demo --dir --api --db `, where `ApiAddress` is a `host:port`, - e.g. `dqlite-demo --dir data --api 127.0.0.1:8001 --db 127.0.0.1:9001`. + e.g. `cowsql-demo --dir data --api 127.0.0.1:8001 --db 127.0.0.1:9001`. Remark that it is important that `--dir` is a path to the newly created `DataDirectory`, otherwise the demo will create a new directory without the existing data. -6. You should have an operational cluster, access it through e.g. the `dqlite` +6. You should have an operational cluster, access it through e.g. the `cowsql` cli tool. -## B.2 Restore existing data and new network/node configuration in `dqlite-demo`. +## B.2 Restore existing data and new network/node configuration in `cowsql-demo`. *Use this when you don't have access to the machines where the database lives and want to start the database with data from a specific node or when you have access to @@ -130,19 +130,19 @@ We will refer to this file by `TargetClusterYaml` and to its location by 7. For every node, make sure there is an `info.yaml` in `NodeDirectory` that is in line with `cluster.yaml` and correct for that node. 8. For every node, run: - `dqlite-demo --dir --api --db `. -9. You should have an operational cluster, access it through e.g. the `dqlite` + `cowsql-demo --dir --api --db `. +9. You should have an operational cluster, access it through e.g. the `cowsql` cli tool. ## Terminology -- ApiAddress: `host:port` where the `dqlite-demo` REST api is available. +- ApiAddress: `host:port` where the `cowsql-demo` REST api is available. - DataDirectory: Base directory under which the NodeDirectories are saved. - data file: segment file, snapshot file or snapshot.meta file. - DbAddress: `host:port` used for database replication. - DbName: name of the sqlite database. - metadata file: file named `metadata1` or `metadata2`. -- NodeDirectory: Directory where node specific data is saved, for `dqlite-demo` +- NodeDirectory: Directory where node specific data is saved, for `cowsql-demo` it should be named `DbAddress` and exist under `DataDirectory`. - segment file: file named like `0000000057685378-0000000057685875`, meaning `startindex-endindex`, these contain raft log entries. diff --git a/driver/driver.go b/driver/driver.go index 1f3d749..fb46865 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -27,18 +27,18 @@ import ( "github.com/pkg/errors" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/internal/protocol" ) -// Driver perform queries against a dqlite server. +// Driver perform queries against a cowsql server. type Driver struct { log client.LogFunc // Log function to use - store client.NodeStore // Holds addresses of dqlite servers + store client.NodeStore // Holds addresses of cowsql servers context context.Context // Global cancellation context connectionTimeout time.Duration // Max time to wait for a new connection contextTimeout time.Duration // Default client context timeout. - clientConfig protocol.Config // Configuration for dqlite client instances + clientConfig protocol.Config // Configuration for cowsql client instances tracing client.LogLevel // Whether to trace statements } @@ -81,7 +81,7 @@ func WithLogFunc(log client.LogFunc) Option { } // DialFunc is a function that can be used to establish a network connection -// with a dqlite node. +// with a cowsql node. type DialFunc = protocol.DialFunc // WithDialFunc sets a custom dial function. @@ -176,7 +176,7 @@ func WithTracing(level client.LogLevel) Option { } } -// NewDriver creates a new dqlite driver, which also implements the +// NewDriver creates a new cowsql driver, which also implements the // driver.Driver interface. func New(store client.NodeStore, options ...Option) (*Driver, error) { o := defaultOptions() @@ -204,7 +204,7 @@ func New(store client.NodeStore, options ...Option) (*Driver, error) { return driver, nil } -// Hold configuration options for a dqlite driver. +// Hold configuration options for a cowsql driver. type options struct { Log client.LogFunc Dial protocol.DialFunc @@ -258,7 +258,7 @@ func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) { var err error conn.protocol, err = connector.Connect(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to create dqlite connection") + return nil, errors.Wrap(err, "failed to create cowsql connection") } conn.request.Init(4096) @@ -295,10 +295,10 @@ func (d *Driver) OpenConnector(name string) (driver.Connector, error) { return connector, nil } -// Open establishes a new connection to a SQLite database on the dqlite server. +// Open establishes a new connection to a SQLite database on the cowsql server. // // The given name must be a pure file name without any directory segment, -// dqlite will connect to a database with that name in its data directory. +// cowsql will connect to a database with that name in its data directory. // // Query parameters are always valid except for "mode=memory". // diff --git a/driver/driver_test.go b/driver/driver_test.go index bbb3ae7..2002caa 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -23,10 +23,10 @@ import ( "strings" "testing" - dqlite "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - dqlitedriver "github.com/canonical/go-dqlite/driver" - "github.com/canonical/go-dqlite/logging" + cowsql "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + cowsqldriver "github.com/cowsql/go-cowsql/driver" + "github.com/cowsql/go-cowsql/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -436,7 +436,7 @@ func TestConn_ExecManyParams(t *testing.T) { } func Test_ColumnTypesEmpty(t *testing.T) { - t.Skip("this currently fails if the result set is empty, is dqlite skipping the header if empty set?") + t.Skip("this currently fails if the result set is empty, is cowsql skipping the header if empty set?") drv, cleanup := newDriver(t) defer cleanup() @@ -567,7 +567,7 @@ func Test_ColumnTypesEnd(t *testing.T) { assert.NoError(t, conn.Close()) } -func newDriver(t *testing.T) (*dqlitedriver.Driver, func()) { +func newDriver(t *testing.T) (*cowsqldriver.Driver, func()) { t.Helper() _, cleanup := newNode(t) @@ -576,7 +576,7 @@ func newDriver(t *testing.T) (*dqlitedriver.Driver, func()) { log := logging.Test(t) - driver, err := dqlitedriver.New(store, dqlitedriver.WithLogFunc(log)) + driver, err := cowsqldriver.New(store, cowsqldriver.WithLogFunc(log)) require.NoError(t, err) return driver, cleanup @@ -593,11 +593,11 @@ func newStore(t *testing.T, address string) client.NodeStore { return store } -func newNode(t *testing.T) (*dqlite.Node, func()) { +func newNode(t *testing.T) (*cowsql.Node, func()) { t.Helper() dir, dirCleanup := newDir(t) - server, err := dqlite.New(uint64(1), "@1", dir, dqlite.WithBindAddress("@1")) + server, err := cowsql.New(uint64(1), "@1", dir, cowsql.WithBindAddress("@1")) require.NoError(t, err) err = server.Start() @@ -615,7 +615,7 @@ func newNode(t *testing.T) (*dqlite.Node, func()) { func newDir(t *testing.T) (string, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-replication-test-") + dir, err := ioutil.TempDir("", "cowsql-replication-test-") assert.NoError(t, err) cleanup := func() { diff --git a/driver/integration_test.go b/driver/integration_test.go index 99dea84..40e485a 100644 --- a/driver/integration_test.go +++ b/driver/integration_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - dqlite "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/driver" - "github.com/canonical/go-dqlite/logging" + cowsql "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/driver" + "github.com/cowsql/go-cowsql/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -329,7 +329,7 @@ func newDBWithInfos(t *testing.T, infos []client.NodeInfo) (*sql.DB, []*nodeHelp driver, err := driver.New(store, driver.WithLogFunc(log)) require.NoError(t, err) - driverName := fmt.Sprintf("dqlite-integration-test-%d", driversCount) + driverName := fmt.Sprintf("cowsql-integration-test-%d", driversCount) sql.Register(driverName, driver) driversCount++ @@ -346,7 +346,7 @@ func newDBWithInfos(t *testing.T, infos []client.NodeInfo) (*sql.DB, []*nodeHelp } func registerDriver(driver *driver.Driver) string { - name := fmt.Sprintf("dqlite-integration-test-%d", driversCount) + name := fmt.Sprintf("cowsql-integration-test-%d", driversCount) sql.Register(name, driver) driversCount++ return name @@ -357,7 +357,7 @@ type nodeHelper struct { ID uint64 Address string Dir string - Node *dqlite.Node + Node *cowsql.Node } func newNodeHelper(t *testing.T, id uint64, address string) *nodeHelper { @@ -384,7 +384,7 @@ func (h *nodeHelper) Client() *client.Client { func (h *nodeHelper) Create() { var err error require.Nil(h.t, h.Node) - h.Node, err = dqlite.New(h.ID, h.Address, h.Dir, dqlite.WithBindAddress(h.Address)) + h.Node, err = cowsql.New(h.ID, h.Address, h.Dir, cowsql.WithBindAddress(h.Address)) require.NoError(h.t, err) } diff --git a/go.mod b/go.mod index 13c9e8e..4b09fc8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/canonical/go-dqlite +module github.com/cowsql/go-cowsql // This is to maintain the ppa package on focal go 1.13 diff --git a/internal/bindings/build.go b/internal/bindings/build.go index 8066638..b2d423b 100644 --- a/internal/bindings/build.go +++ b/internal/bindings/build.go @@ -1,10 +1,10 @@ package bindings /* -#cgo linux LDFLAGS: -ldqlite +#cgo linux LDFLAGS: -lcowsql */ import "C" -// required dqlite version -var dqliteMajorVersion int = 1 -var dqliteMinorVersion int = 14 +// required cowsql version +var cowsqlMajorVersion int = 1 +var cowsqlMinorVersion int = 14 diff --git a/internal/bindings/server.go b/internal/bindings/server.go index 26b0e99..63cc1fc 100644 --- a/internal/bindings/server.go +++ b/internal/bindings/server.go @@ -9,7 +9,7 @@ package bindings #include #include -#include +#include #define RAFT_NOCONNECTION 16 @@ -45,21 +45,21 @@ static int connectTrampoline(void *data, const char *address, int *fd) { } // Configure a custom connect function. -static int configConnectFunc(dqlite_node *t, uintptr_t handle) { - return dqlite_node_set_connect_func(t, connectTrampoline, (void*)handle); +static int configConnectFunc(cowsql_node *t, uintptr_t handle) { + return cowsql_node_set_connect_func(t, connectTrampoline, (void*)handle); } -static dqlite_node_info_ext *makeInfos(int n) { - return calloc(n, sizeof(dqlite_node_info_ext)); +static cowsql_node_info_ext *makeInfos(int n) { + return calloc(n, sizeof(cowsql_node_info_ext)); } -static void setInfo(dqlite_node_info_ext *infos, unsigned i, dqlite_node_id id, +static void setInfo(cowsql_node_info_ext *infos, unsigned i, cowsql_node_id id, const char *address, int role) { - dqlite_node_info_ext *info = &infos[i]; - info->size = sizeof(dqlite_node_info_ext); + cowsql_node_info_ext *info = &infos[i]; + info->size = sizeof(cowsql_node_info_ext); info->id = id; info->address = (uint64_t)(uintptr_t)address; - info->dqlite_role = role; + info->cowsql_role = role; } */ @@ -73,11 +73,11 @@ import ( "time" "unsafe" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) type Node struct { - node *C.dqlite_node + node *C.cowsql_node ctx context.Context cancel context.CancelFunc } @@ -95,16 +95,16 @@ func init() { // NewNode creates a new Node instance. func NewNode(ctx context.Context, id uint64, address string, dir string) (*Node, error) { - requiredVersion := dqliteMajorVersion*100 + dqliteMinorVersion + requiredVersion := cowsqlMajorVersion*100 + cowsqlMinorVersion // Remove the patch version, as patch versions should be compatible. - runtimeVersion := int(C.dqlite_version_number()) / 100 + runtimeVersion := int(C.cowsql_version_number()) / 100 if requiredVersion > runtimeVersion { return nil, fmt.Errorf("version mismatch: required version(%d.%d.x) current version(%d.%d.x)", - dqliteMajorVersion, dqliteMinorVersion, runtimeVersion/100, runtimeVersion%100) + cowsqlMajorVersion, cowsqlMinorVersion, runtimeVersion/100, runtimeVersion%100) } - var server *C.dqlite_node - cid := C.dqlite_node_id(id) + var server *C.cowsql_node + cid := C.cowsql_node_id(id) caddress := C.CString(address) defer C.free(unsafe.Pointer(caddress)) @@ -112,20 +112,20 @@ func NewNode(ctx context.Context, id uint64, address string, dir string) (*Node, cdir := C.CString(dir) defer C.free(unsafe.Pointer(cdir)) - if rc := C.dqlite_node_create(cid, caddress, cdir, &server); rc != 0 { - errmsg := C.GoString(C.dqlite_node_errmsg(server)) - C.dqlite_node_destroy(server) + if rc := C.cowsql_node_create(cid, caddress, cdir, &server); rc != 0 { + errmsg := C.GoString(C.cowsql_node_errmsg(server)) + C.cowsql_node_destroy(server) return nil, fmt.Errorf("%s", errmsg) } - node := &Node{node: (*C.dqlite_node)(unsafe.Pointer(server))} + node := &Node{node: (*C.cowsql_node)(unsafe.Pointer(server))} node.ctx, node.cancel = context.WithCancel(ctx) return node, nil } func (s *Node) SetDialFunc(dial protocol.DialFunc) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) connectLock.Lock() defer connectLock.Unlock() connectIndex++ @@ -138,68 +138,68 @@ func (s *Node) SetDialFunc(dial protocol.DialFunc) error { } func (s *Node) SetBindAddress(address string) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) caddress := C.CString(address) defer C.free(unsafe.Pointer(caddress)) - if rc := C.dqlite_node_set_bind_address(server, caddress); rc != 0 { + if rc := C.cowsql_node_set_bind_address(server, caddress); rc != 0 { return fmt.Errorf("failed to set bind address %q: %d", address, rc) } return nil } func (s *Node) SetNetworkLatency(nanoseconds uint64) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) cnanoseconds := C.nanoseconds_t(nanoseconds) - if rc := C.dqlite_node_set_network_latency(server, cnanoseconds); rc != 0 { + if rc := C.cowsql_node_set_network_latency(server, cnanoseconds); rc != 0 { return fmt.Errorf("failed to set network latency") } return nil } func (s *Node) SetSnapshotParams(params SnapshotParams) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) cthreshold := C.unsigned(params.Threshold) ctrailing := C.unsigned(params.Trailing) - if rc := C.dqlite_node_set_snapshot_params(server, cthreshold, ctrailing); rc != 0 { + if rc := C.cowsql_node_set_snapshot_params(server, cthreshold, ctrailing); rc != 0 { return fmt.Errorf("failed to set snapshot params") } return nil } func (s *Node) SetFailureDomain(code uint64) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) ccode := C.failure_domain_t(code) - if rc := C.dqlite_node_set_failure_domain(server, ccode); rc != 0 { + if rc := C.cowsql_node_set_failure_domain(server, ccode); rc != 0 { return fmt.Errorf("set failure domain: %d", rc) } return nil } func (s *Node) EnableDiskMode() error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) - if rc := C.dqlite_node_enable_disk_mode(server); rc != 0 { + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) + if rc := C.cowsql_node_enable_disk_mode(server); rc != 0 { return fmt.Errorf("failed to set disk mode") } return nil } func (s *Node) GetBindAddress() string { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) - return C.GoString(C.dqlite_node_get_bind_address(server)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) + return C.GoString(C.cowsql_node_get_bind_address(server)) } func (s *Node) Start() error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) - if rc := C.dqlite_node_start(server); rc != 0 { - errmsg := C.GoString(C.dqlite_node_errmsg(server)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) + if rc := C.cowsql_node_start(server); rc != 0 { + errmsg := C.GoString(C.cowsql_node_errmsg(server)) return fmt.Errorf("%s", errmsg) } return nil } func (s *Node) Stop() error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) - if rc := C.dqlite_node_stop(server); rc != 0 { + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) + if rc := C.cowsql_node_stop(server); rc != 0 { return fmt.Errorf("task stopped with error code %d", rc) } return nil @@ -208,8 +208,8 @@ func (s *Node) Stop() error { // Close the server releasing all used resources. func (s *Node) Close() { defer s.cancel() - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) - C.dqlite_node_destroy(server) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) + C.cowsql_node_destroy(server) } // Remark that Recover doesn't take the node role into account @@ -222,18 +222,18 @@ func (s *Node) Recover(cluster []protocol.NodeInfo) error { // RecoverExt has a similar purpose as `Recover` but takes the node role into account func (s *Node) RecoverExt(cluster []protocol.NodeInfo) error { - server := (*C.dqlite_node)(unsafe.Pointer(s.node)) + server := (*C.cowsql_node)(unsafe.Pointer(s.node)) n := C.int(len(cluster)) infos := C.makeInfos(n) defer C.free(unsafe.Pointer(infos)) for i, info := range cluster { - cid := C.dqlite_node_id(info.ID) + cid := C.cowsql_node_id(info.ID) caddress := C.CString(info.Address) crole := C.int(info.Role) defer C.free(unsafe.Pointer(caddress)) C.setInfo(infos, C.unsigned(i), cid, caddress, crole) } - if rc := C.dqlite_node_recover_ext(server, infos, n); rc != 0 { + if rc := C.cowsql_node_recover_ext(server, infos, n); rc != 0 { return fmt.Errorf("recover failed with error code %d", rc) } return nil @@ -243,7 +243,7 @@ func (s *Node) RecoverExt(cluster []protocol.NodeInfo) error { func GenerateID(address string) uint64 { caddress := C.CString(address) defer C.free(unsafe.Pointer(caddress)) - id := C.dqlite_generate_node_id(caddress) + id := C.cowsql_generate_node_id(caddress) return uint64(id) } diff --git a/internal/bindings/server_test.go b/internal/bindings/server_test.go index 3f4ce31..09b2d5e 100644 --- a/internal/bindings/server_test.go +++ b/internal/bindings/server_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/canonical/go-dqlite/internal/bindings" - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/bindings" + "github.com/cowsql/go-cowsql/internal/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -213,7 +213,7 @@ func makeClientRequest(t *testing.T, conn net.Conn, kind byte) []byte { func newDir(t *testing.T) (string, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-replication-test-") + dir, err := ioutil.TempDir("", "cowsql-replication-test-") assert.NoError(t, err) cleanup := func() { diff --git a/internal/bindings/sqlite3.go b/internal/bindings/sqlite3.go index 59ca273..c2f84a7 100644 --- a/internal/bindings/sqlite3.go +++ b/internal/bindings/sqlite3.go @@ -3,7 +3,7 @@ package bindings import ( - "github.com/canonical/go-dqlite/internal/protocol" + "github.com/cowsql/go-cowsql/internal/protocol" ) /* diff --git a/internal/protocol/config.go b/internal/protocol/config.go index de5272d..4b47452 100644 --- a/internal/protocol/config.go +++ b/internal/protocol/config.go @@ -4,7 +4,7 @@ import ( "time" ) -// Config holds various configuration parameters for a dqlite client. +// Config holds various configuration parameters for a cowsql client. type Config struct { Dial DialFunc // Network dialer. DialTimeout time.Duration // Timeout for establishing a network connection . diff --git a/internal/protocol/connector.go b/internal/protocol/connector.go index 44f0022..88e8746 100644 --- a/internal/protocol/connector.go +++ b/internal/protocol/connector.go @@ -12,14 +12,14 @@ import ( "github.com/Rican7/retry" "github.com/Rican7/retry/backoff" "github.com/Rican7/retry/strategy" - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/logging" "github.com/pkg/errors" ) // DialFunc is a function that can be used to establish a network connection. type DialFunc func(context.Context, string) (net.Conn, error) -// Connector is in charge of creating a dqlite SQL client connected to the +// Connector is in charge of creating a cowsql SQL client connected to the // current leader of a cluster. type Connector struct { id uint64 // Conn ID to use when registering against the server. @@ -28,8 +28,8 @@ type Connector struct { log logging.Func // Logging function. } -// NewConnector returns a new connector that can be used by a dqlite driver to -// create new clients connected to a leader dqlite server. +// NewConnector returns a new connector that can be used by a cowsql driver to +// create new clients connected to a leader cowsql server. func NewConnector(id uint64, store NodeStore, config Config, log logging.Func) *Connector { if config.Dial == nil { config.Dial = Dial @@ -212,7 +212,7 @@ func Handshake(ctx context.Context, conn net.Conn, version uint64) (*Protocol, e return newProtocol(version, conn), nil } -// Connect to the given dqlite server and check if it's the leader. +// Connect to the given cowsql server and check if it's the leader. // // Return values: // @@ -247,7 +247,7 @@ func (c *Connector) connectAttemptOne(ctx context.Context, address string, versi if err := protocol.Call(ctx, &request, &response); err != nil { protocol.Close() cause := errors.Cause(err) - // Best-effort detection of a pre-1.0 dqlite node: when sent + // Best-effort detection of a pre-1.0 cowsql node: when sent // version 1 it should close the connection immediately. if err, ok := cause.(*net.OpError); ok && !err.Timeout() || cause == io.EOF { return nil, "", errBadProtocol diff --git a/internal/protocol/connector_test.go b/internal/protocol/connector_test.go index 2c24e5d..23cacef 100644 --- a/internal/protocol/connector_test.go +++ b/internal/protocol/connector_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/canonical/go-dqlite/internal/bindings" - "github.com/canonical/go-dqlite/internal/protocol" - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/internal/bindings" + "github.com/cowsql/go-cowsql/internal/protocol" + "github.com/cowsql/go-cowsql/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -352,7 +352,7 @@ func newNode(t *testing.T, index int) (string, func()) { func newDir(t *testing.T) (string, func()) { t.Helper() - dir, err := ioutil.TempDir("", "dqlite-connector-test-") + dir, err := ioutil.TempDir("", "cowsql-connector-test-") assert.NoError(t, err) cleanup := func() { diff --git a/internal/protocol/constants.go b/internal/protocol/constants.go index 12393ce..1423cfe 100644 --- a/internal/protocol/constants.go +++ b/internal/protocol/constants.go @@ -3,7 +3,7 @@ package protocol // VersionOne is version 1 of the server protocol. const VersionOne = uint64(1) -// VersionLegacy is the pre 1.0 dqlite server protocol version. +// VersionLegacy is the pre 1.0 cowsql server protocol version. const VersionLegacy = uint64(0x86104dd760433fe5) // Cluster response formats diff --git a/internal/protocol/errors.go b/internal/protocol/errors.go index 79d1fed..3d7cbdd 100644 --- a/internal/protocol/errors.go +++ b/internal/protocol/errors.go @@ -6,7 +6,7 @@ import ( // Client errors. var ( - ErrNoAvailableLeader = fmt.Errorf("no available dqlite leader server found") + ErrNoAvailableLeader = fmt.Errorf("no available cowsql leader server found") errStop = fmt.Errorf("connector was stopped") errStaleLeader = fmt.Errorf("server has lost leadership") errNotClustered = fmt.Errorf("server is not clustered") diff --git a/internal/protocol/protocol.go b/internal/protocol/protocol.go index 8a48ffc..6a6604a 100644 --- a/internal/protocol/protocol.go +++ b/internal/protocol/protocol.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" ) -// Protocol sends and receive the dqlite message on the wire. +// Protocol sends and receive the cowsql message on the wire. type Protocol struct { version uint64 // Protocol version conn net.Conn // Underlying network connection. @@ -30,10 +30,10 @@ func newProtocol(version uint64, conn net.Conn) *Protocol { return protocol } -// Call invokes a dqlite RPC, sending a request message and receiving a +// Call invokes a cowsql RPC, sending a request message and receiving a // response message. func (p *Protocol) Call(ctx context.Context, request, response *Message) (err error) { - // We need to take a lock since the dqlite server currently does not + // We need to take a lock since the cowsql server currently does not // support concurrent requests. p.mu.Lock() defer p.mu.Unlock() @@ -82,7 +82,7 @@ func (p *Protocol) More(ctx context.Context, response *Message) error { // Interrupt sends an interrupt request and awaits for the server's empty // response. func (p *Protocol) Interrupt(ctx context.Context, request *Message, response *Message) error { - // We need to take a lock since the dqlite server currently does not + // We need to take a lock since the cowsql server currently does not // support concurrent requests. p.mu.Lock() defer p.mu.Unlock() diff --git a/internal/protocol/protocol_test.go b/internal/protocol/protocol_test.go index df5d07e..6def872 100644 --- a/internal/protocol/protocol_test.go +++ b/internal/protocol/protocol_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/canonical/go-dqlite/internal/protocol" - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/internal/protocol" + "github.com/cowsql/go-cowsql/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/internal/protocol/store.go b/internal/protocol/store.go index 5930e5c..9946351 100644 --- a/internal/protocol/store.go +++ b/internal/protocol/store.go @@ -29,8 +29,8 @@ type NodeInfo struct { Role NodeRole `yaml:"Role"` } -// NodeStore is used by a dqlite client to get an initial list of candidate -// dqlite servers that it can dial in order to find a leader server to connect +// NodeStore is used by a cowsql client to get an initial list of candidate +// cowsql servers that it can dial in order to find a leader server to connect // to. // // Once connected, the client periodically updates the server addresses in the diff --git a/internal/shell/options.go b/internal/shell/options.go index 070f880..fd9ef3b 100644 --- a/internal/shell/options.go +++ b/internal/shell/options.go @@ -1,19 +1,19 @@ package shell -import "github.com/canonical/go-dqlite/client" +import "github.com/cowsql/go-cowsql/client" // Option that can be used to tweak shell parameters. type Option func(*options) -// WithDialFunc sets a custom dial function for connecting to dqlite endpoints. +// WithDialFunc sets a custom dial function for connecting to cowsql endpoints. func WithDialFunc(dial client.DialFunc) Option { return func(options *options) { options.Dial = dial } } -// WithDriverName sets a custom name for the registered dqlite driver. The -// default is "dqlite". +// WithDriverName sets a custom name for the registered cowsql driver. The +// default is "cowsql". func WithDriverName(name string) Option { return func(options *options) { options.DriverName = name @@ -37,7 +37,7 @@ type options struct { func defaultOptions() *options { return &options{ Dial: client.DefaultDialFunc, - DriverName: "dqlite", + DriverName: "cowsql", Format: formatTabular, } } diff --git a/internal/shell/shell.go b/internal/shell/shell.go index 5d7a573..d4966a8 100644 --- a/internal/shell/shell.go +++ b/internal/shell/shell.go @@ -12,12 +12,12 @@ import ( "strconv" "strings" - "github.com/canonical/go-dqlite" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/driver" + "github.com/cowsql/go-cowsql" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/driver" ) -// Shell can be used to implement interactive prompts for inspecting a dqlite +// Shell can be used to implement interactive prompts for inspecting a cowsql // database. type Shell struct { store client.NodeStore @@ -96,7 +96,7 @@ func (s *Shell) Process(ctx context.Context, line string) (string, error) { func (s *Shell) processHelp() string { return ` -Dqlite shell is a simple interactive prompt for inspecting a dqlite database. +Cowsql shell is a simple interactive prompt for inspecting a cowsql database. Enter a SQL statement to execute it, or one of the following built-in commands: .cluster Show the cluster membership @@ -261,7 +261,7 @@ func (s *Shell) processReconfigure(ctx context.Context, line string) (string, er "\tUse this command when trying to preserve the data from your cluster while changing the\n" + "\tconfiguration of the cluster because e.g. your cluster is broken due to unreachablee nodes.\n" + "\t0. BACKUP ALL YOUR NODE DATA DIRECTORIES BEFORE PROCEEDING!\n" + - "\t1. Stop all dqlite nodes.\n" + + "\t1. Stop all cowsql nodes.\n" + "\t2. Identify the dir of the node with the most up to date raft term and log, this will be the argument.\n" + "\t3. Create a .yaml file with the same format as cluster.yaml (or use/adapt an existing cluster.yaml) with the\n " + "\t desired cluster configuration. This will be the argument.\n" + @@ -271,7 +271,7 @@ func (s *Shell) processReconfigure(ctx context.Context, line string) (string, er "\t from over to the directories of the other nodes identified in , deleting any leftover snapshot-xxx-xxx-xxx, snapshot-xxx-xxx-xxx.meta,\n" + "\t segment (00000xxxxx-000000xxxxx, open-xxx) and metadata{1,2} files that it contains.\n" + "\t Make sure an info.yaml is also present that is in line with cluster.yaml.\n" + - "\t6. Start all the dqlite nodes.\n" + + "\t6. Start all the cowsql nodes.\n" + "\t7. If, for some reason, this fails or gives undesired results, try again with data from another node (you should still have this from step 0).\n") } dir := parts[1] @@ -287,7 +287,7 @@ func (s *Shell) processReconfigure(ctx context.Context, line string) (string, er return "NOK", fmt.Errorf("failed to retrieve NodeInfo list :%v", err) } - err = dqlite.ReconfigureMembershipExt(dir, servers) + err = cowsql.ReconfigureMembershipExt(dir, servers) if err != nil { return "NOK", fmt.Errorf("failed to reconfigure membership :%v", err) } diff --git a/logging/func_test.go b/logging/func_test.go index 1a0465d..9ed9ff0 100644 --- a/logging/func_test.go +++ b/logging/func_test.go @@ -3,7 +3,7 @@ package logging_test import ( "testing" - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/logging" ) func Test_TestFunc(t *testing.T) { diff --git a/logging/level_test.go b/logging/level_test.go index 00487c4..a0738a0 100644 --- a/logging/level_test.go +++ b/logging/level_test.go @@ -3,7 +3,7 @@ package logging_test import ( "testing" - "github.com/canonical/go-dqlite/logging" + "github.com/cowsql/go-cowsql/logging" "github.com/stretchr/testify/assert" ) diff --git a/node.go b/node.go index baa5e94..7200473 100644 --- a/node.go +++ b/node.go @@ -1,15 +1,15 @@ -package dqlite +package cowsql import ( "context" "time" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/internal/bindings" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/internal/bindings" "github.com/pkg/errors" ) -// Node runs a dqlite node. +// Node runs a cowsql node. type Node struct { log client.LogFunc // Logger server *bindings.Node // Low-level C implementation @@ -23,7 +23,7 @@ type Node struct { // NodeInfo is a convenience alias for client.NodeInfo. type NodeInfo = client.NodeInfo -// SnapshotParams exposes bindings.SnapshotParams. Used for setting dqlite's +// SnapshotParams exposes bindings.SnapshotParams. Used for setting cowsql's // snapshot parameters. // SnapshotParams.Threshold controls after how many raft log entries a snapshot is // taken. The higher this number, the lower the frequency of the snapshots. @@ -69,7 +69,7 @@ func WithSnapshotParams(params SnapshotParams) Option { } } -// WithDiskMode enables dqlite disk-mode on the node. +// WithDiskMode enables cowsql disk-mode on the node. // WARNING: This is experimental API, use with caution // and prepare for data loss. // UNSTABLE: Behavior can change in future. @@ -162,7 +162,7 @@ func (s *Node) Recover(cluster []NodeInfo) error { return s.server.Recover(cluster) } -// Hold configuration options for a dqlite server. +// Hold configuration options for a cowsql server. type options struct { Log client.LogFunc DialFunc client.DialFunc @@ -176,7 +176,7 @@ type options struct { // Close the server, releasing all resources it created. func (s *Node) Close() error { s.cancel() - // Send a stop signal to the dqlite event loop. + // Send a stop signal to the cowsql event loop. if err := s.server.Stop(); err != nil { return errors.Wrap(err, "server failed to stop") } @@ -216,7 +216,7 @@ func ReconfigureMembership(dir string, cluster []NodeInfo) error { // It forces appending a new configuration to the raft log stored in the given // directory, effectively replacing the current configuration. // In comparision with ReconfigureMembership, this function takes the node role -// into account and makes use of a dqlite API that supports extending the +// into account and makes use of a cowsql API that supports extending the // NodeInfo struct. func ReconfigureMembershipExt(dir string, cluster []NodeInfo) error { server, err := bindings.NewNode(context.Background(), 1, "1", dir) diff --git a/test/dqlite-demo-util.sh b/test/cowsql-demo-util.sh similarity index 80% rename from test/dqlite-demo-util.sh rename to test/cowsql-demo-util.sh index bb26309..c228eab 100755 --- a/test/dqlite-demo-util.sh +++ b/test/cowsql-demo-util.sh @@ -1,10 +1,10 @@ -# dqlite-demo test utilities +# cowsql-demo test utilities GO=${GO:-go} VERBOSE=${VERBOSE:-0} DISK=${DISK:-0} -$GO build -tags libsqlite3 ./cmd/dqlite-demo/ +$GO build -tags libsqlite3 ./cmd/cowsql-demo/ DIR=$(mktemp -d) @@ -23,7 +23,7 @@ start_node() { disk="--disk" fi - ./dqlite-demo --dir "$DIR" --api=127.0.0.1:800"${n}" --db=127.0.0.1:900"${n}" "$join" $verbose $disk & + ./cowsql-demo --dir "$DIR" --api=127.0.0.1:800"${n}" --db=127.0.0.1:900"${n}" "$join" $verbose $disk & echo "${!}" > "${pidfile}" i=0 @@ -60,7 +60,7 @@ set_up_node() { join=--join=127.0.0.1:9001 fi - echo "=> Set up dqlite-demo node $n" + echo "=> Set up cowsql-demo node $n" start_node "${n}" "${join}" } @@ -68,13 +68,13 @@ set_up_node() { tear_down_node() { n=$1 - echo "=> Tear down dqlite-demo node $n" + echo "=> Tear down cowsql-demo node $n" kill_node "$n" } set_up() { - echo "=> Set up dqlite-demo cluster" + echo "=> Set up cowsql-demo cluster" set_up_node 1 set_up_node 2 set_up_node 3 @@ -84,7 +84,7 @@ tear_down() { err=$? trap '' HUP INT TERM - echo "=> Tear down dqlite-demo cluster" + echo "=> Tear down cowsql-demo cluster" tear_down_node 3 tear_down_node 2 tear_down_node 1 diff --git a/test/dqlite-demo.sh b/test/cowsql-demo.sh similarity index 89% rename from test/dqlite-demo.sh rename to test/cowsql-demo.sh index 503f2c3..20b7928 100755 --- a/test/dqlite-demo.sh +++ b/test/cowsql-demo.sh @@ -1,9 +1,9 @@ #!/bin/sh -eu # -# Test the dqlite-demo application. +# Test the cowsql-demo application. BASEDIR=$(dirname "$0") -. "$BASEDIR"/dqlite-demo-util.sh +. "$BASEDIR"/cowsql-demo-util.sh trap tear_down EXIT trap sig_handler HUP INT TERM diff --git a/test/recover.sh b/test/recover.sh index af71e78..4785147 100755 --- a/test/recover.sh +++ b/test/recover.sh @@ -1,11 +1,11 @@ #!/bin/sh -eu # -# Test the dqlite cluster recovery. +# Test the cowsql cluster recovery. BASEDIR=$(dirname "$0") -. "$BASEDIR"/dqlite-demo-util.sh +. "$BASEDIR"/cowsql-demo-util.sh -$GO build -tags libsqlite3 ./cmd/dqlite/ +$GO build -tags libsqlite3 ./cmd/cowsql/ trap tear_down EXIT trap sig_handler HUP INT TERM @@ -44,7 +44,7 @@ cat < "$target_yaml" Role: 1 EOF -if ! ./dqlite -s 127.0.0.1:9001 test ".reconfigure ${node1_dir} ${target_yaml}"; then +if ! ./cowsql -s 127.0.0.1:9001 test ".reconfigure ${node1_dir} ${target_yaml}"; then echo "Error: Reconfigure failed" exit 1 fi @@ -54,22 +54,22 @@ start_node 1 "" start_node 2 "" echo "=> Confirming new config" -if [ "$(./dqlite -s 127.0.0.1:9001 test .leader)" != 127.0.0.1:9001 ]; then +if [ "$(./cowsql -s 127.0.0.1:9001 test .leader)" != 127.0.0.1:9001 ]; then echo "Error: Expected node 1 to be leader" exit 1 fi -if [ "$(./dqlite -s 127.0.0.1:9001 test .cluster | wc -l)" != 2 ]; then +if [ "$(./cowsql -s 127.0.0.1:9001 test .cluster | wc -l)" != 2 ]; then echo "Error: Expected 2 servers in the cluster" exit 1 fi -if ! ./dqlite -s 127.0.0.1:9001 test .cluster | grep -q "127.0.0.1:9001|voter"; then +if ! ./cowsql -s 127.0.0.1:9001 test .cluster | grep -q "127.0.0.1:9001|voter"; then echo "Error: server 1 not voter" exit 1 fi -if ! ./dqlite -s 127.0.0.1:9001 test .cluster | grep -q "127.0.0.1:9002|stand-by"; then +if ! ./cowsql -s 127.0.0.1:9001 test .cluster | grep -q "127.0.0.1:9002|stand-by"; then echo "Error: server 2 not stand-by" exit 1 fi diff --git a/test/roles.sh b/test/roles.sh index 8338961..778f492 100755 --- a/test/roles.sh +++ b/test/roles.sh @@ -10,7 +10,7 @@ CLUSTER=127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003,127.0.0.1:9004,127.0.0.1:90 N=7 DISK=${DISK:-0} -$GO build -tags libsqlite3 ./cmd/dqlite/ +$GO build -tags libsqlite3 ./cmd/cowsql/ set_up_binary() { @@ -25,8 +25,8 @@ import ( "time" "path/filepath" "strconv" - "github.com/canonical/go-dqlite/client" - "github.com/canonical/go-dqlite/app" + "github.com/cowsql/go-cowsql/client" + "github.com/cowsql/go-cowsql/app" "golang.org/x/sys/unix" ) @@ -106,15 +106,15 @@ wait_stable() { i=0 while true; do i=$(expr $i + 1) - voters=$(./dqlite -s "$CLUSTER" test .cluster | grep voter | wc -l) - standbys=$(./dqlite -s "$CLUSTER" test .cluster | grep stand-by | wc -l) - spares=$(./dqlite -s "$CLUSTER" test .cluster | grep spare | wc -l) + voters=$(./cowsql -s "$CLUSTER" test .cluster | grep voter | wc -l) + standbys=$(./cowsql -s "$CLUSTER" test .cluster | grep stand-by | wc -l) + spares=$(./cowsql -s "$CLUSTER" test .cluster | grep spare | wc -l) if [ "$voters" -eq 3 ] && [ "$standbys" -eq 3 ] && [ "$spares" -eq 1 ] ; then break fi if [ "$i" -eq 40 ]; then echo "Error: node roles not yet stable after 10 seconds" - ./dqlite -s "$CLUSTER" test .cluster + ./cowsql -s "$CLUSTER" test .cluster exit 1 fi sleep 0.25 @@ -128,13 +128,13 @@ wait_role() { i=0 while true; do i=$(expr $i + 1) - current=$(./dqlite -s "$CLUSTER" test .cluster | grep "127.0.0.1:900${index}" | cut -f 3 -d "|") + current=$(./cowsql -s "$CLUSTER" test .cluster | grep "127.0.0.1:900${index}" | cut -f 3 -d "|") if [ "$current" = "$role" ]; then break fi if [ "$i" -eq 40 ]; then echo "Error: node $index has role $current instead of $role" - ./dqlite -s "$CLUSTER" test .cluster + ./cowsql -s "$CLUSTER" test .cluster exit 1 fi sleep 0.25 From c2fdc0796950d945029f663822aa4ae6d957c68c Mon Sep 17 00:00:00 2001 From: Free Ekanayaka Date: Wed, 9 Aug 2023 23:20:33 +0100 Subject: [PATCH 3/3] [workflows] build-and-test: Reduce test matrix Only test against Ubuntu 22.04 and Go 1.20. No disk mode. --- .github/workflows/build-and-test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ee08872..fe45d9e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,19 +9,10 @@ jobs: fail-fast: false matrix: go: - - 1.13.x - - 1.14.x - - 1.15.x - - 1.16.x - - 1.17.x - - 1.18.x - - 1.19.x - 1.20.x os: - - ubuntu-20.04 - ubuntu-22.04 disk: - - 1 - 0 runs-on: ${{ matrix.os }} steps: