Skip to content

Bootstrap can lead to doubled buckets #650

Description

@Serpentian

It's not a good idea to allow bootstrapping the cluster without any synchronization. Consider the case:

1. User bootstrapps the cluster, only on 1 replicaset buckets are created.
2. Master is changed in that replicaset. Old master still considers itself a master (due to misconfiguration), it considers itself syncrhonized, since it did that between 1 and 2.
3. User calls boostrap one more time, it passes, since the new leader doesn't have the buckets, created on the old one.
4. Old master considers itself in sync, sends the buckets to another replicaset
5. We have doubled buckets.

Instead, I propose to make map call over masters in cluster_bootstrap and wait there for masters to be in sync. After that we make map call one more time and create the buckets (with protection for is_sync). Though, the bootstrap can still fail, if master changes between these two map calls, though, it seems we're ok with it now, since partial boostrap is anyway possible now, if master changes and router doesn't know about that yet (see (see #499).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions