Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Drop unused function #736

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions router/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type RelayStateMgr interface {
ProcessMessageBuf(waitForResp, replyCl, completeRelay bool, cmngr poolmgr.PoolMgr) (bool, error)
RelayRunCommand(msg pgproto3.FrontendMessage, waitForResp bool, replyCl bool) error

Sync(waitForResp, replyCl bool, cmngr poolmgr.PoolMgr) error

ProcQuery(query pgproto3.FrontendMessage, waitForResp bool, replyCl bool) (txstatus.TXStatus, []pgproto3.BackendMessage, bool, error)
ProcCopy(query pgproto3.FrontendMessage) error

Expand Down Expand Up @@ -1579,35 +1577,6 @@ func (rst *RelayStateImpl) ProcessMessageBuf(waitForResp, replyCl, completeRelay
}
}

// TODO : unit tests
func (rst *RelayStateImpl) Sync(waitForResp, replyCl bool, cmngr poolmgr.PoolMgr) error {
spqrlog.Zero.Debug().
Uint("client", rst.Client().ID()).
Msg("client relay exeсuting sync for client")

// if we have no active connections, we have noting to sync
if !cmngr.ConnectionActive(rst) {
return rst.Client().ReplyRFQ(rst.TxStatus())
}
if err := rst.PrepareRelayStep(cmngr); err != nil {
return err
}

if _, _, err := rst.RelayFlush(waitForResp, replyCl); err != nil {
/* Relay flush completes relay */
return err
}

if err := rst.CompleteRelay(replyCl); err != nil {
return err
}

if _, _, err := rst.RelayStep(&pgproto3.Sync{}, waitForResp, replyCl); err != nil {
return err
}
return nil
}

// TODO : unit tests
func (rst *RelayStateImpl) ProcessMessage(
msg pgproto3.FrontendMessage,
Expand Down
Loading