@@ -80,7 +80,7 @@ func (r *nodeSQLRunner) Wait(ctx context.Context) error {
8080
8181func (r * nodeSQLRunner ) DisableSuperReadOnly (ctx context.Context ) (func (), error ) {
8282 enable := func () {
83- err := r .runQuery (ctx , "SET GLOBAL SUPER_READ_ONLY = 0 ;" )
83+ err := r .runQuery (ctx , "SET GLOBAL SUPER_READ_ONLY = 1 ;" )
8484 if err != nil {
8585 log .Error (err , "failed to set node super read only" , "node" , r .Host ())
8686 }
@@ -123,6 +123,7 @@ func (r *nodeSQLRunner) ChangeMasterTo(ctx context.Context, masterHost, user, pa
123123 return nil
124124}
125125
126+ // MarkConfigurationDone write in a MEMORY table value. The readiness probe checks for that value to exist to succeed.
126127func (r * nodeSQLRunner ) MarkConfigurationDone (ctx context.Context ) error {
127128 query := `
128129 CREATE TABLE IF NOT EXISTS %s.%s (
@@ -131,7 +132,7 @@ func (r *nodeSQLRunner) MarkConfigurationDone(ctx context.Context) error {
131132
132133 INSERT INTO %[1]s.%[2]s VALUES (1);
133134 `
134- query = fmt .Sprintf (query , constants .OperatorDbName , "readiness" )
135+ query = fmt .Sprintf (query , constants .OperatorDbName , constants . OperatorReadinessTableName )
135136
136137 if err := r .runQuery (ctx , query ); err != nil {
137138 return fmt .Errorf ("failed to mark configuration done, err: %s" , err )
@@ -210,10 +211,11 @@ func (r *nodeSQLRunner) SetPurgedGTID(ctx context.Context) error {
210211 var used bool
211212 if err := r .readFromMysql (ctx , qq , & used ); err != nil {
212213 // if it's a: "Table doesn't exist" error then GTID should not be set, it's a master case.
213- if isMySQLError (err , 1146 ) {
214+ if isMySQLError (err , 1146 ) || err == sql . ErrNoRows {
214215 log .V (1 ).Info ("GTID purged table does not exists" , "host" , r .Host ())
215216 return nil
216217 }
218+
217219 return err
218220 }
219221
0 commit comments