Skip to content

Commit

Permalink
fix: refine the session variables accessing (#193) (#226)
Browse files Browse the repository at this point in the history
* feat(pg): supports SET/SHOW statement (#193)

* fix: bypass the configuration of DuckDB setting to backend DuckDB connection

* fix: solve problems of getting and setting session variables

* fix: solve problems of unit test in binlogreplication

* fix: RESET ALL is not supported yet

* refactor: move handlers for pg_catalog to a new file

* fix: adopt CR feedback
  • Loading branch information
VWagen1989 authored Nov 29, 2024
1 parent e536c63 commit ab8a581
Show file tree
Hide file tree
Showing 15 changed files with 5,679 additions and 377 deletions.
5 changes: 3 additions & 2 deletions binlogreplication/binlog_replication_reconnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/Shopify/toxiproxy/v2"
toxiproxyclient "github.com/Shopify/toxiproxy/v2/client"
"github.com/apecloud/myduckserver/test"
"github.com/prometheus/client_golang/prometheus"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -152,7 +153,7 @@ func showReplicaStatus(t *testing.T) map[string]interface{} {
}

func configureToxiProxy(t *testing.T) {
toxiproxyPort := findFreePort()
toxiproxyPort := test.FindFreePort()

metrics := toxiproxy.NewMetricsContainer(prometheus.NewRegistry())
toxiproxyServer := toxiproxy.NewServer(metrics, zerolog.Nop())
Expand All @@ -164,7 +165,7 @@ func configureToxiProxy(t *testing.T) {

toxiClient = toxiproxyclient.NewClient(fmt.Sprintf("localhost:%d", toxiproxyPort))

proxyPort = findFreePort()
proxyPort = test.FindFreePort()
var err error
mysqlProxy, err = toxiClient.CreateProxy("mysql",
fmt.Sprintf("localhost:%d", proxyPort), // downstream
Expand Down
8 changes: 6 additions & 2 deletions binlogreplication/binlog_replication_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"testing"
"time"

"github.com/apecloud/myduckserver/test"
"github.com/stretchr/testify/require"
)

Expand All @@ -45,12 +46,15 @@ func TestBinlogReplicationServerRestart(t *testing.T) {

// Let the replica process a few transactions, then stop the server and pause a second
waitForReplicaToReachGtid(t, 3)
stopDuckSqlServer(t)
test.StopDuckSqlServer(t, duckProcess)
time.Sleep(1000 * time.Millisecond)

var err error
duckPort, duckProcess, err = startDuckSqlServer(testDir, nil)
testEnv := test.NewTestEnv()
setupTestEnv(testEnv)
err = test.StartDuckSqlServer(t, testDir, nil, testEnv)
require.NoError(t, err)
loadEnvFromTestEnv(testEnv)

// Check replication status on the replica and assert configuration persisted
status := showReplicaStatus(t)
Expand Down
Loading

0 comments on commit ab8a581

Please sign in to comment.