Skip to content

dbdeployer deploy replication returns before replica ready. #131

Description

@jfg956

Environment

  • dbdeployer version: 2.3.0
  • Go version (if building from source): Not applicable as using ProxySQL binaries
  • OS: Debian 12.14
  • MySQL/database version: 8.4.10 (and 9.7.1)
  • Flavor: MySQL
  • Topology: replication

Describe the bug

After running dbdeployer deploy replication, s1 is not ready. It looks like a race condition, because if I wait 5 seconds, it is then ready.

Steps to reproduce

function deploy_call_stop_rm() {
  local v=$1
  dbdeployer deploy replication $v -n 2 | pv -tN dbdepl. > /dev/null
  local d=${v//./_}; cd ~/sandboxes/rsandbox_$d
  ./m -N <<< "select 'm'"
  ./s1 -N <<< "select 's1'"
  sleep 5 
  ./s1 -N <<< "select 's1(bis)'"
  ./stop_all | pv -tN stop > /dev/null
  rm -rf ~/sandboxes/rsandbox_$d; cd
}

deploy_call_stop_rm mysql_8.4.10

# Running above gives below.
  dbdepl.: 0:00:13
m
ERROR 1045 (28000): Access denied for user 'msandbox'@'localhost' (using password: YES)
s1 (bis)
     stop: 0:00:14

Expected behavior

In above, I would expect a s1 output, not an Access denied.

Actual behavior

I get an Access denied when running the first query on s1. After waiting 5 seconds, I get the expected result.

Hardware (if applicable)

AWS vm with local SSDs (m6id.large). Linux and MySQL binaries are on Magnetic Disks, the sandbox is on SSDs.

Additional context

It looks like a cache effect. Subsequent call to deploy_call_stop_rm does not show the error. But then purging caches causes it again (echo 3 > /proc/sys/vm/drop_caches).

I am guessing the msandbox user is not yet replicated on s1 when running the 1st query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions