Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Read workers fail to connect to mysql server #65

Open
stephanievu opened this issue Aug 9, 2019 · 3 comments
Open

Read workers fail to connect to mysql server #65

stephanievu opened this issue Aug 9, 2019 · 3 comments

Comments

@stephanievu
Copy link
Contributor

What I Did

  1. Rear & Write workers were configured to point to same DB:
    bash-3.2$ env | grep TWO_TASK
    TWO_TASK_READ=tcp(127.0.0.1:3306)/world?timeout=10s
    TWO_TASK=tcp(127.0.0.1:3306)/world?timeout=10s

  2. I set readonly_children_pct=50 in hera.txt

What I Expected
When starting server, I expected all read & write workers to start successfully

What I Saw Instead
Hera Read workers fail to start
state.log:
08/08/2019 17:35:58: hera.w 0 2 0 0 0 0 0 0 0 0 0
08/08/2019 17:35:58: hera.r 2 0 0 0 0 0 0 0 0 0 0
08/08/2019 17:35:59: hera.w 0 2 0 0 0 0 0 0 0 0 0
08/08/2019 17:35:59: hera.r 2 0 0 0 0 0 0 0 0 0 0
08/08/2019 17:36:00: hera.w 0 2 0 0 0 0 0 0 0 0 0

Error in log:
10:52:51.876367 info: [R-WORKER 6 workerservice.go:103] DB heartbeat interval: 2m0s
10:52:51.876722 info: [R-WORKER 6 cmdprocessor.go:713] setup db connection.
10:52:51.932530 warn: [R-WORKER 5 adapter.go:75] recycling, got read-only conn
10:52:51.932706 warn: [R-WORKER 5 cmdprocessor.go:719] driver error cannot use read-only conn tcp(10.244.64.202:3306)/world
10:52:51.932728 warn: [R-WORKER 5 workerservice.go:117] Can't connect to DB: cannot use read-only conn tcp(10.244.64.202:3306)/world

@ModEtchFill
Copy link
Collaborator

We think the Oracle RAC read-write split won't work with MySQL. Oracle RAC has synchronous replication which most MySQL clusters don't.

In any case, we'll need to adjust the heartbeat checks for the r workers so they connect.

@ModEtchFill
Copy link
Collaborator

This may prevent use of Transparent Failover. We should test

@stephanievu
Copy link
Contributor Author

I tested out with TAF enable, taf workers cannot connect to mysql DB server and taf workers stay in "init" status
Error in hera log:
11:34:05.763268 warn: [S0-WORKER 1 339228 cmdprocessor.go:812] driver error cannot use read-only conn tcp(10.180.128.159:3115)/clocschema?timeout=12s&tls=preferred&clientFoundRows=true
11:34:05.763286 warn: [S0-WORKER 1 339228 workerservice.go:130] Can't connect to DB: cannot use read-only conn tcp(10.180.128.159:3115)/clocschema?timeout=12s&tls=preferred&clientFoundRows=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants