Skip to content

Automatic master discovery #113

Closed
@Totktonada

Description

@Totktonada

I propose to implement quite simple master discovery algorithm on top of existing connection pool (multi). Key points:

  • Poll box.info.ro on each instance every X seconds.
  • Add mode = 'any' / 'ro' / 'prefer_ro' / 'prefer_rw' / 'rw' parameter for Call, Eval, Execute, Select, Ping, Insert, Replace, Delete, Update, Upsert.
  • Fail fast: if we have no rw instance ATM -> report the fail to a caller.
  • Fail fast: got ER_READ_ONLY -> report it to a caller.

Later we'll reimplement it for fresh tarantool versions using watchers instead of polling. Not in the scope of this issue.

Later we'll design a good retry strategy, but it is okay for now to leave it for a user.

mode parameter may be discussed: proposals backed by arguments (not just opinion) are appreciated.

RFC is here.

Metadata

Metadata

Assignees

Labels

featureA new functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions