tarantool / tarantool/queue

Master-master replication incompatibility.

Open
#60 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Lua
Stars
244
Forks
56
PR merge metrics
No merged PRs in 30d

Description

Consider following case:

Few (let's say 3) nodes in a cluster, with master-master replication.
Each node has it's own queue with name, unique in cluster.
As each tube need to have its own space, these spaces will be created.
But ID of each space may be not unique, as they created on each node separately at virtually the same time.
As a result, there will be errors like

E> ER_TUPLE_FOUND: Duplicate key exists in unique index 'primary' in space '_space'
E> ER_TUPLE_FOUND: Duplicate key exists in unique index 'primary' in space '_index'

in logs.
These errors are fatal for replication. And therefore replication stops.

Following solutions could be proposed:

  1. Change in application: change cluster startup logic, so it'll create all necessary tubes in box.once(). Later each node can pick appropriate queue somehow, and use it.
  2. Change in tarantool-queue: Ensure space ID is globally-unique in cluster. (But how to ensure it?)
  3. Mixed change: tarantool-queue to provide interface to specify ID of a new tube space, so application can assign cluster-unique values for them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or implementation entry points are named. Start by tracing tarantool-queue's tube-space creation and the cluster startup logic around box.once(), then reproduce the duplicate _space and _index errors with master-master replication; done means replication remains running without duplicate-ID failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.