MCPcopy Create free account
hub / github.com/apecloud/myduckserver / getReplicaLogPosition

Function getReplicaLogPosition

binlogreplication/binlog_replication_test.go:734–747  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

732}
733
734func getReplicaLogPosition(t *testing.T) (string, string) {
735 rows, err := replicaDatabase.Queryx("SHOW REPLICA STATUS;")
736 require.NoError(t, err)
737 replicaStatus := convertMapScanResultToStrings(readNextRow(t, rows))
738 executedGtidSet := replicaStatus["Executed_Gtid_Set"].(string)
739 require.NoError(t, rows.Close())
740
741 // the executedGtidSet is like the format of "binlog.000002:6757", split it into file and pos
742 parts := strings.Split(executedGtidSet, ":")
743 require.Equal(t, 2, len(parts))
744 sourceLogFile := parts[0]
745 sourceLogPos := parts[1]
746 return sourceLogFile, sourceLogPos
747}
748
749// startReplication configures the replication source on the replica and runs the START REPLICA statement.
750func startReplication(t *testing.T, port int) {

Callers 1

queryGtidFunction · 0.85

Calls 3

readNextRowFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected