From b154ba49e4dfc35fa170e4381592307adcd3bf66 Mon Sep 17 00:00:00 2001 From: Konrad Wojas Date: Fri, 7 Jun 2024 21:44:39 +0800 Subject: [PATCH 1/3] Rename module to github.com/PowerDNS/lightningstream/lmdbenv --- cmd/lightningstream/commands/dropshadow.go | 6 +++--- cmd/lightningstream/commands/dump.go | 8 ++++---- .../commands/experimental-pdns.go | 6 +++--- cmd/lightningstream/commands/experimental.go | 6 +++--- cmd/lightningstream/commands/root.go | 4 ++-- cmd/lightningstream/commands/snapshots.go | 8 ++++---- cmd/lightningstream/commands/stats.go | 6 +++--- cmd/lightningstream/commands/sync.go | 6 +++--- cmd/lightningstream/main.go | 2 +- config/config.go | 10 +++++----- go.mod | 2 +- lmdbenv/stats/collector.go | 2 +- lmdbenv/stats/collector_test.go | 2 +- lmdbenv/stats/log.go | 2 +- lmdbenv/strategy/append_test.go | 2 +- lmdbenv/strategy/iterput_test.go | 2 +- lmdbenv/strategy/iterupdate_test.go | 2 +- lmdbenv/strategy/put_test.go | 2 +- lmdbenv/strategy/testutil_test.go | 2 +- lmdbenv/strategy/update_test.go | 2 +- snapshot/doc.go | 6 +++--- snapshot/flags.go | 2 +- snapshot/gogosnapshot/compat_test.go | 6 +++--- snapshot/name.go | 4 ++-- status/httpd.go | 2 +- status/status.go | 6 +++--- syncer/cleaner/cleaner.go | 6 +++--- syncer/cleaner/cleaner_test.go | 4 ++-- syncer/dupsorthack.go | 4 ++-- syncer/dupsorthack_test.go | 4 ++-- syncer/env.go | 4 ++-- syncer/iterators.go | 4 ++-- syncer/metrics.go | 2 +- syncer/receiver/downloader.go | 6 +++--- syncer/receiver/receiver.go | 10 +++++----- syncer/receiver/receiver_test.go | 4 ++-- syncer/send.go | 8 ++++---- syncer/send_test.go | 6 +++--- syncer/shadow.go | 10 +++++----- syncer/shadow_test.go | 8 ++++---- syncer/sync.go | 16 ++++++++-------- syncer/sync_test.go | 10 +++++----- syncer/syncer.go | 8 ++++---- syncer/utils.go | 10 +++++----- 44 files changed, 116 insertions(+), 116 deletions(-) diff --git a/cmd/lightningstream/commands/dropshadow.go b/cmd/lightningstream/commands/dropshadow.go index 89ce245..004897e 100644 --- a/cmd/lightningstream/commands/dropshadow.go +++ b/cmd/lightningstream/commands/dropshadow.go @@ -4,13 +4,13 @@ import ( "sort" "strings" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/syncer" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/syncer" ) func init() { diff --git a/cmd/lightningstream/commands/dump.go b/cmd/lightningstream/commands/dump.go index 6e152da..d207492 100644 --- a/cmd/lightningstream/commands/dump.go +++ b/cmd/lightningstream/commands/dump.go @@ -5,14 +5,14 @@ import ( "sort" "strings" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/syncer" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/syncer" - "powerdns.com/platform/lightningstream/utils" ) var ( diff --git a/cmd/lightningstream/commands/experimental-pdns.go b/cmd/lightningstream/commands/experimental-pdns.go index 93c01fc..56c7de3 100644 --- a/cmd/lightningstream/commands/experimental-pdns.go +++ b/cmd/lightningstream/commands/experimental-pdns.go @@ -7,13 +7,13 @@ import ( "strings" "time" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/lmdb-go/lmdbscan" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/utils" ) func init() { diff --git a/cmd/lightningstream/commands/experimental.go b/cmd/lightningstream/commands/experimental.go index 1d3c848..a76e8e1 100644 --- a/cmd/lightningstream/commands/experimental.go +++ b/cmd/lightningstream/commands/experimental.go @@ -4,13 +4,13 @@ import ( "encoding/binary" "fmt" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/lmdb-go/lmdbscan" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/utils" ) func init() { diff --git a/cmd/lightningstream/commands/root.go b/cmd/lightningstream/commands/root.go index 4021033..8fb0d13 100644 --- a/cmd/lightningstream/commands/root.go +++ b/cmd/lightningstream/commands/root.go @@ -7,11 +7,11 @@ import ( "os/exec" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/config/logger" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/config/logger" ) const ( diff --git a/cmd/lightningstream/commands/snapshots.go b/cmd/lightningstream/commands/snapshots.go index 40e4195..ed413fe 100644 --- a/cmd/lightningstream/commands/snapshots.go +++ b/cmd/lightningstream/commands/snapshots.go @@ -10,15 +10,15 @@ import ( "path/filepath" "time" + "github.com/PowerDNS/lightningstream/lmdbenv/dbiflags" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/simpleblob" "github.com/samber/lo" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "golang.org/x/exp/slices" - "powerdns.com/platform/lightningstream/lmdbenv/dbiflags" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) func init() { diff --git a/cmd/lightningstream/commands/stats.go b/cmd/lightningstream/commands/stats.go index dcd6b07..3b2bd4e 100644 --- a/cmd/lightningstream/commands/stats.go +++ b/cmd/lightningstream/commands/stats.go @@ -4,14 +4,14 @@ import ( "fmt" "sort" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/stats" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/c2h5oh/datasize" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/stats" ) func init() { diff --git a/cmd/lightningstream/commands/sync.go b/cmd/lightningstream/commands/sync.go index e2616e6..c28a373 100644 --- a/cmd/lightningstream/commands/sync.go +++ b/cmd/lightningstream/commands/sync.go @@ -4,14 +4,14 @@ import ( "context" "os" + "github.com/PowerDNS/lightningstream/status" + "github.com/PowerDNS/lightningstream/syncer" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/simpleblob" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/wojas/go-healthz" "golang.org/x/sync/errgroup" - "powerdns.com/platform/lightningstream/status" - "powerdns.com/platform/lightningstream/syncer" - "powerdns.com/platform/lightningstream/utils" ) var ( diff --git a/cmd/lightningstream/main.go b/cmd/lightningstream/main.go index 2621fd4..fcf01ce 100644 --- a/cmd/lightningstream/main.go +++ b/cmd/lightningstream/main.go @@ -1,7 +1,7 @@ package main import ( - "powerdns.com/platform/lightningstream/cmd/lightningstream/commands" + "github.com/PowerDNS/lightningstream/cmd/lightningstream/commands" // Register storage backends _ "github.com/PowerDNS/simpleblob/backends/fs" diff --git a/config/config.go b/config/config.go index 3509b4a..df5bc9b 100644 --- a/config/config.go +++ b/config/config.go @@ -7,15 +7,15 @@ import ( "os" "time" + "github.com/PowerDNS/lightningstream/lmdbenv/dbiflags" "github.com/pkg/errors" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" - "powerdns.com/platform/lightningstream/lmdbenv/dbiflags" - "powerdns.com/platform/lightningstream/config/logger" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/status/healthtracker" - "powerdns.com/platform/lightningstream/status/starttracker" + "github.com/PowerDNS/lightningstream/config/logger" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/status/healthtracker" + "github.com/PowerDNS/lightningstream/status/starttracker" ) const ( diff --git a/go.mod b/go.mod index 907c152..d5cd7f6 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module powerdns.com/platform/lightningstream +module github.com/PowerDNS/lightningstream go 1.19 diff --git a/lmdbenv/stats/collector.go b/lmdbenv/stats/collector.go index 0dfbb31..2902c27 100644 --- a/lmdbenv/stats/collector.go +++ b/lmdbenv/stats/collector.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) // Collector implements an LMDB stats collector for Prometheus. diff --git a/lmdbenv/stats/collector_test.go b/lmdbenv/stats/collector_test.go index 8b831b5..ea01a70 100644 --- a/lmdbenv/stats/collector_test.go +++ b/lmdbenv/stats/collector_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/PowerDNS/lightningstream/lmdbenv" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/prometheus/client_golang/prometheus" - "powerdns.com/platform/lightningstream/lmdbenv" ) func TestCollector(t *testing.T) { diff --git a/lmdbenv/stats/log.go b/lmdbenv/stats/log.go index 9aa18f0..2d426de 100644 --- a/lmdbenv/stats/log.go +++ b/lmdbenv/stats/log.go @@ -4,10 +4,10 @@ package stats import ( "os" + "github.com/PowerDNS/lightningstream/lmdbenv" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv" ) // Log logs all LMDB statistics once using logrus diff --git a/lmdbenv/strategy/append_test.go b/lmdbenv/strategy/append_test.go index ec5b0e1..f6ab191 100644 --- a/lmdbenv/strategy/append_test.go +++ b/lmdbenv/strategy/append_test.go @@ -3,8 +3,8 @@ package strategy import ( "testing" + "github.com/PowerDNS/lightningstream/lmdbenv" "github.com/PowerDNS/lmdb-go/lmdb" - "powerdns.com/platform/lightningstream/lmdbenv" ) func TestAppend(t *testing.T) { diff --git a/lmdbenv/strategy/iterput_test.go b/lmdbenv/strategy/iterput_test.go index e6d5535..98aa7b8 100644 --- a/lmdbenv/strategy/iterput_test.go +++ b/lmdbenv/strategy/iterput_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) func TestIterPut_empty(t *testing.T) { diff --git a/lmdbenv/strategy/iterupdate_test.go b/lmdbenv/strategy/iterupdate_test.go index 35dbe39..62efcf8 100644 --- a/lmdbenv/strategy/iterupdate_test.go +++ b/lmdbenv/strategy/iterupdate_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) func TestIterUpdate_empty(t *testing.T) { diff --git a/lmdbenv/strategy/put_test.go b/lmdbenv/strategy/put_test.go index 69a668d..acdc908 100644 --- a/lmdbenv/strategy/put_test.go +++ b/lmdbenv/strategy/put_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) func TestPut(t *testing.T) { diff --git a/lmdbenv/strategy/testutil_test.go b/lmdbenv/strategy/testutil_test.go index 08ca14b..fb5a24f 100644 --- a/lmdbenv/strategy/testutil_test.go +++ b/lmdbenv/strategy/testutil_test.go @@ -9,7 +9,7 @@ import ( "github.com/PowerDNS/lmdb-go/lmdb" "github.com/pkg/errors" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) type TestIterator struct { diff --git a/lmdbenv/strategy/update_test.go b/lmdbenv/strategy/update_test.go index 3ad6dcc..53d879d 100644 --- a/lmdbenv/strategy/update_test.go +++ b/lmdbenv/strategy/update_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "powerdns.com/platform/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv" ) // Test iterator does not do dedup! diff --git a/snapshot/doc.go b/snapshot/doc.go index cc32cde..2ca64b0 100644 --- a/snapshot/doc.go +++ b/snapshot/doc.go @@ -22,13 +22,13 @@ In total that is 440 MB data uncompressed. It turns out that half of the allocation was used by the code copying all key and value bytes. flat flat% sum% cum cum% - 2047.55MB 56.26% 56.26% 2722.09MB 74.80% powerdns.com/platform/lightningstream/snapshot.(*DBI).Unmarshal - 674.54MB 18.54% 98.45% 674.54MB 18.54% powerdns.com/platform/lightningstream/snapshot.(*KV).Unmarshal + 2047.55MB 56.26% 56.26% 2722.09MB 74.80% github.com/PowerDNS/lightningstream/snapshot.(*DBI).Unmarshal + 674.54MB 18.54% 98.45% 674.54MB 18.54% github.com/PowerDNS/lightningstream/snapshot.(*KV).Unmarshal Patching the generated code to not copy the data reduced the total memory use to 1.4 GB: - 1378.77MB 52.20% 52.20% 1378.77MB 52.20% powerdns.com/platform/lightningstream/snapshot.(*DBI).Unmarshal + 1378.77MB 52.20% 52.20% 1378.77MB 52.20% github.com/PowerDNS/lightningstream/snapshot.(*DBI).Unmarshal That is still significantly more than the 440 MB we would expect. Part of it is likely because the allocated slices are up to 2x larger than needed with diff --git a/snapshot/flags.go b/snapshot/flags.go index 95b2874..02df131 100644 --- a/snapshot/flags.go +++ b/snapshot/flags.go @@ -1,6 +1,6 @@ package snapshot -import "powerdns.com/platform/lightningstream/lmdbenv/header" +import "github.com/PowerDNS/lightningstream/lmdbenv/header" func (kv *KV) MaskedFlags() header.Flags { return header.Flags(kv.Flags).Masked() diff --git a/snapshot/gogosnapshot/compat_test.go b/snapshot/gogosnapshot/compat_test.go index 1bdbafa..f7e740b 100644 --- a/snapshot/gogosnapshot/compat_test.go +++ b/snapshot/gogosnapshot/compat_test.go @@ -6,8 +6,8 @@ import ( "math/rand" "testing" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/stretchr/testify/assert" - "powerdns.com/platform/lightningstream/snapshot" ) func Test_roundtrip_compat_generated(t *testing.T) { @@ -31,7 +31,7 @@ func Test_roundtrip_compat_manual(t *testing.T) { }, Databases: []*DBI{ { - Name: "test-dbi-1", + Name: "test-dbi-1", Entries: []KV{ // Filled below }, @@ -39,7 +39,7 @@ func Test_roundtrip_compat_manual(t *testing.T) { Transform: "", }, { - Name: "test-dbi-2", + Name: "test-dbi-2", Entries: []KV{ // Filled below }, diff --git a/snapshot/name.go b/snapshot/name.go index 23dc6b8..963b318 100644 --- a/snapshot/name.go +++ b/snapshot/name.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/utils" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/utils" ) const ( diff --git a/status/httpd.go b/status/httpd.go index 0536125..dd76f5b 100644 --- a/status/httpd.go +++ b/status/httpd.go @@ -13,7 +13,7 @@ import ( "github.com/sirupsen/logrus" "github.com/wojas/go-healthz" - "powerdns.com/platform/lightningstream/config" + "github.com/PowerDNS/lightningstream/config" ) func StartHTTPServer(c config.Config) { diff --git a/status/status.go b/status/status.go index b19b324..c4a0683 100644 --- a/status/status.go +++ b/status/status.go @@ -4,13 +4,13 @@ import ( "context" "sync" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/dbiflags" + "github.com/PowerDNS/lightningstream/lmdbenv/stats" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/simpleblob" "github.com/c2h5oh/datasize" "github.com/pkg/errors" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/dbiflags" - "powerdns.com/platform/lightningstream/lmdbenv/stats" ) type info struct { diff --git a/syncer/cleaner/cleaner.go b/syncer/cleaner/cleaner.go index a293786..7cf407b 100644 --- a/syncer/cleaner/cleaner.go +++ b/syncer/cleaner/cleaner.go @@ -5,13 +5,13 @@ import ( "sync" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/simpleblob" "github.com/samber/lo" "github.com/sirupsen/logrus" "golang.org/x/exp/slices" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) func New(name string, st simpleblob.Interface, cc config.Cleanup, logger logrus.FieldLogger) *Worker { diff --git a/syncer/cleaner/cleaner_test.go b/syncer/cleaner/cleaner_test.go index 82687d4..6032eed 100644 --- a/syncer/cleaner/cleaner_test.go +++ b/syncer/cleaner/cleaner_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/PowerDNS/simpleblob/backends/memory" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/snapshot" ) func mt(timeString string) time.Time { diff --git a/syncer/dupsorthack.go b/syncer/dupsorthack.go index 755972e..c6d350a 100644 --- a/syncer/dupsorthack.go +++ b/syncer/dupsorthack.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" ) const ( diff --git a/syncer/dupsorthack_test.go b/syncer/dupsorthack_test.go index ccfa966..8d94a75 100644 --- a/syncer/dupsorthack_test.go +++ b/syncer/dupsorthack_test.go @@ -4,9 +4,9 @@ import ( "bytes" "testing" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/stretchr/testify/assert" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" ) func rep(ch byte, n int) []byte { diff --git a/syncer/env.go b/syncer/env.go index 6aa5075..9fa69f0 100644 --- a/syncer/env.go +++ b/syncer/env.go @@ -1,11 +1,11 @@ package syncer import ( + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/c2h5oh/datasize" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" ) // OpenEnv opens the LMDB env with the right options diff --git a/syncer/iterators.go b/syncer/iterators.go index 4eeec73..2ddf70c 100644 --- a/syncer/iterators.go +++ b/syncer/iterators.go @@ -6,9 +6,9 @@ import ( "errors" "fmt" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" ) func NewNativeIterator( diff --git a/syncer/metrics.go b/syncer/metrics.go index e261813..8f13eac 100644 --- a/syncer/metrics.go +++ b/syncer/metrics.go @@ -1,8 +1,8 @@ package syncer import ( + "github.com/PowerDNS/lightningstream/lmdbenv/stats" "github.com/prometheus/client_golang/prometheus" - "powerdns.com/platform/lightningstream/lmdbenv/stats" ) var ( diff --git a/syncer/receiver/downloader.go b/syncer/receiver/downloader.go index a8b3d74..6969c0b 100644 --- a/syncer/receiver/downloader.go +++ b/syncer/receiver/downloader.go @@ -4,10 +4,10 @@ import ( "context" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) type Downloader struct { diff --git a/syncer/receiver/receiver.go b/syncer/receiver/receiver.go index 8bcd6c8..8568bb3 100644 --- a/syncer/receiver/receiver.go +++ b/syncer/receiver/receiver.go @@ -6,14 +6,14 @@ import ( "sync" "time" + "github.com/PowerDNS/lightningstream/utils/climit" "github.com/PowerDNS/simpleblob" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/utils/climit" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/status/healthtracker" - "powerdns.com/platform/lightningstream/utils" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/status/healthtracker" + "github.com/PowerDNS/lightningstream/utils" ) func New(st simpleblob.Interface, c config.Config, dbname string, l logrus.FieldLogger, inst string) *Receiver { diff --git a/syncer/receiver/receiver_test.go b/syncer/receiver/receiver_test.go index 2d8f981..7707c56 100644 --- a/syncer/receiver/receiver_test.go +++ b/syncer/receiver/receiver_test.go @@ -11,8 +11,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/snapshot" ) func emptySnapshot() []byte { diff --git a/syncer/send.go b/syncer/send.go index fe7807d..6c59d2c 100644 --- a/syncer/send.go +++ b/syncer/send.go @@ -6,13 +6,13 @@ import ( "strings" "time" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/c2h5oh/datasize" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) func (s *Syncer) SendOnce(ctx context.Context, env *lmdb.Env) (txnID header.TxnID, err error) { diff --git a/syncer/send_test.go b/syncer/send_test.go index 47b3c3c..401f4c4 100644 --- a/syncer/send_test.go +++ b/syncer/send_test.go @@ -6,13 +6,13 @@ import ( "testing" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/simpleblob/backends/memory" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/require" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" ) func BenchmarkSyncer_SendOnce_native_100k(b *testing.B) { diff --git a/syncer/shadow.go b/syncer/shadow.go index eddc0b1..65b5656 100644 --- a/syncer/shadow.go +++ b/syncer/shadow.go @@ -6,13 +6,13 @@ import ( "strings" "time" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/lmdbenv/strategy" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/lmdbenv/strategy" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) // mainToShadow syncs the current databases to shadow databases with timestamps. diff --git a/syncer/shadow_test.go b/syncer/shadow_test.go index bf03816..afc6fde 100644 --- a/syncer/shadow_test.go +++ b/syncer/shadow_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/stretchr/testify/assert" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" ) func b(s string) []byte { diff --git a/syncer/sync.go b/syncer/sync.go index 2f44bd2..d048919 100644 --- a/syncer/sync.go +++ b/syncer/sync.go @@ -6,16 +6,16 @@ import ( "strings" "time" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/dbiflags" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/lmdbenv/strategy" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/status" + "github.com/PowerDNS/lightningstream/syncer/receiver" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/dbiflags" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/lmdbenv/strategy" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/status" - "powerdns.com/platform/lightningstream/syncer/receiver" - "powerdns.com/platform/lightningstream/utils" ) const ( diff --git a/syncer/sync_test.go b/syncer/sync_test.go index af94c61..140ba35 100644 --- a/syncer/sync_test.go +++ b/syncer/sync_test.go @@ -11,16 +11,16 @@ import ( "testing" "time" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/config/logger" + "github.com/PowerDNS/lightningstream/lmdbenv" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/snapshot" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/simpleblob" "github.com/PowerDNS/simpleblob/backends/memory" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/config/logger" - "powerdns.com/platform/lightningstream/lmdbenv" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/snapshot" ) const testLMDBName = "default" diff --git a/syncer/syncer.go b/syncer/syncer.go index 50402a6..4f839d7 100644 --- a/syncer/syncer.go +++ b/syncer/syncer.go @@ -4,14 +4,14 @@ import ( "fmt" "time" + "github.com/PowerDNS/lightningstream/syncer/cleaner" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/PowerDNS/simpleblob" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/syncer/cleaner" - "powerdns.com/platform/lightningstream/config" - "powerdns.com/platform/lightningstream/status/healthtracker" - "powerdns.com/platform/lightningstream/status/starttracker" + "github.com/PowerDNS/lightningstream/config" + "github.com/PowerDNS/lightningstream/status/healthtracker" + "github.com/PowerDNS/lightningstream/status/starttracker" ) func New(name string, env *lmdb.Env, st simpleblob.Interface, c config.Config, lc config.LMDB, opt Options) (*Syncer, error) { diff --git a/syncer/utils.go b/syncer/utils.go index 8119133..bc3a493 100644 --- a/syncer/utils.go +++ b/syncer/utils.go @@ -9,14 +9,14 @@ import ( "regexp" "time" + "github.com/PowerDNS/lightningstream/lmdbenv/dbiflags" + "github.com/PowerDNS/lightningstream/lmdbenv/header" + "github.com/PowerDNS/lightningstream/lmdbenv/stats" + "github.com/PowerDNS/lightningstream/snapshot" + "github.com/PowerDNS/lightningstream/utils" "github.com/PowerDNS/lmdb-go/lmdb" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "powerdns.com/platform/lightningstream/lmdbenv/dbiflags" - "powerdns.com/platform/lightningstream/lmdbenv/header" - "powerdns.com/platform/lightningstream/lmdbenv/stats" - "powerdns.com/platform/lightningstream/snapshot" - "powerdns.com/platform/lightningstream/utils" ) const ( From 4207353bf0b5a1508502e0b1baf76a01f7154403 Mon Sep 17 00:00:00 2001 From: Konrad Wojas Date: Fri, 7 Jun 2024 21:49:45 +0800 Subject: [PATCH 2/3] tests: use relative import paths --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index dca8a9e..ae67ff1 100755 --- a/test.sh +++ b/test.sh @@ -19,7 +19,7 @@ go test -race -count=5 "$@" ./... GOMAXPROCS=1 go test -race -count=5 "$@" ./... # This one used to be flaky, run a few more times -go test -count 20 -run TestSyncer_Sync_startup powerdns.com/platform/lightningstream/syncer +go test -count 20 -run TestSyncer_Sync_startup ./syncer # Configure linters in .golangci.yml GOBIN="$PWD/bin" go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.0 From 4ab17be80293c1abbf4b9896f428eaddfd83b6ec Mon Sep 17 00:00:00 2001 From: Konrad Wojas Date: Fri, 7 Jun 2024 22:07:20 +0800 Subject: [PATCH 3/3] proto: remove commented out option It included the old package path and was not used. --- snapshot/gogosnapshot/snapshot.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/snapshot/gogosnapshot/snapshot.proto b/snapshot/gogosnapshot/snapshot.proto index 6d513bd..0f5b5d5 100644 --- a/snapshot/gogosnapshot/snapshot.proto +++ b/snapshot/gogosnapshot/snapshot.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package gogosnapshot; -//option go_package = "powerdns.com/platform/lightningstream/snapshot"; - import "gogo.proto"; option (gogoproto.goproto_unrecognized_all) = false; option (gogoproto.goproto_sizecache_all) = false;