good morning!!!!

Skip to content
Snippets Groups Projects
Commit cec174f1 authored by Garet Halliday's avatar Garet Halliday
Browse files

fix txn mode, split pairing time from active time in metrics

parent c681f702
Branches
Tags
No related merge requests found
...@@ -118,7 +118,7 @@ func MakeCleartextScramVerifier(username, password string, hashGenerator scram.H ...@@ -118,7 +118,7 @@ func MakeCleartextScramVerifier(username, password string, hashGenerator scram.H
} }
kf := scram.KeyFactors{ kf := scram.KeyFactors{
Iters: 1, Iters: 4096,
} }
stored := client.GetStoredCredentials(kf) stored := client.GetStoredCredentials(kf)
......
...@@ -6,6 +6,7 @@ const ( ...@@ -6,6 +6,7 @@ const (
ConnStateActive ConnState = iota ConnStateActive ConnState = iota
ConnStateIdle ConnStateIdle
ConnStateAwaitingServer ConnStateAwaitingServer
ConnStatePairing
ConnStateRunningResetQuery ConnStateRunningResetQuery
ConnStateCount ConnStateCount
...@@ -15,6 +16,7 @@ var connStateString = [ConnStateCount]string{ ...@@ -15,6 +16,7 @@ var connStateString = [ConnStateCount]string{
ConnStateActive: "active", ConnStateActive: "active",
ConnStateIdle: "idle", ConnStateIdle: "idle",
ConnStateAwaitingServer: "awaiting server", ConnStateAwaitingServer: "awaiting server",
ConnStatePairing: "pairing",
ConnStateRunningResetQuery: "running reset query", ConnStateRunningResetQuery: "running reset query",
} }
......
...@@ -10,8 +10,15 @@ import ( ...@@ -10,8 +10,15 @@ import (
) )
func Pair(options Options, client *Client, server *Server) (clientErr, serverErr error) { func Pair(options Options, client *Client, server *Server) (clientErr, serverErr error) {
defer func() {
client.SetState(metrics.ConnStateActive, server.GetID()) client.SetState(metrics.ConnStateActive, server.GetID())
server.SetState(metrics.ConnStateActive, client.GetID()) server.SetState(metrics.ConnStateActive, client.GetID())
}()
if options.ParameterStatusSync != ParameterStatusSyncNone || options.ExtendedQuerySync {
client.SetState(metrics.ConnStatePairing, server.GetID())
server.SetState(metrics.ConnStatePairing, client.GetID())
}
switch options.ParameterStatusSync { switch options.ParameterStatusSync {
case ParameterStatusSyncDynamic: case ParameterStatusSyncDynamic:
......
...@@ -6,5 +6,6 @@ func Apply(options pool.Options) pool.Options { ...@@ -6,5 +6,6 @@ func Apply(options pool.Options) pool.Options {
options.Pooler = new(Pooler) options.Pooler = new(Pooler)
options.ParameterStatusSync = pool.ParameterStatusSyncDynamic options.ParameterStatusSync = pool.ParameterStatusSyncDynamic
options.ExtendedQuerySync = true options.ExtendedQuerySync = true
options.ReleaseAfterTransaction = true
return options return options
} }
...@@ -24,7 +24,7 @@ func TestTester(t *testing.T) { ...@@ -24,7 +24,7 @@ func TestTester(t *testing.T) {
}, },
Peer: dialer.Net{ Peer: dialer.Net{
Network: "tcp", Network: "tcp",
Address: "localhost:5432", Address: "localhost:6432",
AcceptOptions: backends.AcceptOptions{ AcceptOptions: backends.AcceptOptions{
Credentials: credentials.Cleartext{ Credentials: credentials.Cleartext{
Username: "postgres", Username: "postgres",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment