-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli/start+init: Deprecate implicit initialization on absence of --join
flag
#24118
Comments
The just-added |
--join
flag--join
flag
@piyush-singh @jseldess FYI I have prepared a PR (#28495) to address this issue a while ago; however it's not merged yet and Ben suggests in #28495 (comment) that you should be the folk green lighting this work. What do you think? |
(If doc bandwidth is an issue, I could volunteer to draft the necessary changes myself.) |
@knz, I'm all in favor of this change and can commit to make the required docs changes. Will be a good opportunity to clean things up anyway. Let me know what else you need from me. |
Agreed that we should take this on from a PM perspective - I've seen user confused by this across several support channels and I know I was confused about this myself when I first started. I can help acceptance test and work with Jesse on any docs reviews. |
ok then I'll revive the pr |
Are we blocking natural growth by not allowing a path from one node to many nodes? I could easily imagine a test with one node and then adding two more nodes to the cluster to see what three-node looks like. Part of our value prop is easily scaling up the number of nodes. I suppose you could make the argument that one node setup is for testing and no production cluster should have less than three nodes but it seems like this might add friction. |
The path would still exist - it would still be possible to grow the cluster from 1 to more, but there would be one additional step: increase the replication factor from 1 to N |
28495: cli: new command 'start-single-node' r=knz a=knz Fixes #24118. Fixes #21429. Suggested/requested by @bdarnell: > There are currently two ways to initialize a cluster: Starting the first node without a --join flag, or starting all nodes with --join flags and running a separate cockroach init command. This redundancy is confusing (our docs use both methods without explaining the difference) and it's easy to accidentally initialize a new cluster by restarting your first node with the wrong flags. (This could have catastrophic consequences in 1.1 because data from the two clusters could get mixed. We've added safeguards against this in 2.0 but it's still an easy way to break things.) > I think that we should deprecate this implicit initialization mode and make the --join flag mandatory when starting a node (and therefore the init command would be mandatory too). To avoid adding too much complexity to single-node clusters, I propose a new `cockroach start-single-node` command to perform the start and init combination that is today implicit in the absence of a --join flag. > This would have a side benefit that we would know when the user intends to keep the cluster as a single node instead of adding more later. The `start-single-node` command could therefore set the replication factor to 1 to disable the "underreplicated ranges" warning. This patch implements the new `start-single-node` command as follows: - the new command does not accept `--join`. - it attempts to set the replication factor to 1 upon starting up. Meanwhile `cockroach start` is changed to produce a deprecation warning if `--join` is not specified. Release note (cli change): a new command `cockroach start-single-node` is introduced to start single-node clusters with replication disabled. Release note (cli change): using `cockroach start` without `--join` is now deprecated and this mode of execution will be removed in a later version of CockroachDB. Consider using `cockroach start-single-node` instead or combine `cockroach start` with `cockroach init`. Co-authored-by: Raphael 'kena' Poss <[email protected]>
it is done |
Fixes cockroachdb#44116. Informs cockroachdb#24118. Reviving cockroachdb#44112. Release note (backward-incompatible change): A CockroachDB node started with cockroach start without the --join flag no longer automatically initializes the cluster. The cockrach init command is now mandatory. The auto-initialization behavior had been deprecated in version 19.2.
Fixes cockroachdb#44116. Informs cockroachdb#24118. Reviving cockroachdb#44112. We remove the deprecated behavior of crdb where we previously auto-initialized the cluster when `cockroach start` was invoked without a corresponding `--join` flag. We update a few tests along the way that made use of this behavior by changing them to either explicitly init, or now lean on `roachprod` changes (from cockroachdb#51329) that transparently manage initialization. Release note (backward-incompatible change): A CockroachDB node started with cockroach start without the --join flag no longer automatically initializes the cluster. The `cockroach init` command is now mandatory. The auto-initialization behavior had been deprecated in version 19.2. Release note (backward-incompatible change): `cockroach start` without `--join` is no longer supported. It was deprecated in a previous release.
Fixes cockroachdb#44116. Informs cockroachdb#24118. Reviving cockroachdb#44112. We remove the deprecated behavior of crdb where we previously auto-initialized the cluster when `cockroach start` was invoked without a corresponding `--join` flag. We update a few tests along the way that made use of this behavior by changing them to either explicitly init, or now lean on `roachprod` changes (from cockroachdb#51329) that transparently manage initialization. Release note (backward-incompatible change): A CockroachDB node started with cockroach start without the --join flag no longer automatically initializes the cluster. The `cockroach init` command is now mandatory. The auto-initialization behavior had been deprecated in version 19.2. Release note (backward-incompatible change): `cockroach start` without `--join` is no longer supported. It was deprecated in a previous release.
51245: cli: remove auto-init with `cockroach start` without `--join` r=irfansharif a=irfansharif Fixes #44116. Informs #24118. Reviving #44112. Release note (backward-incompatible change): A CockroachDB node started with cockroach start without the --join flag no longer automatically initializes the cluster. The cockrach init command is now mandatory. The auto-initialization behavior had been deprecated in version 19.2. Co-authored-by: irfan sharif <[email protected]>
There are currently two ways to initialize a cluster: Starting the first node without a
--join
flag, or starting all nodes with--join
flags and running a separatecockroach init
command. This redundancy is confusing (our docs use both methods without explaining the difference. cockroachdb/docs#2756) and it's easy to accidentally initialize a new cluster by restarting your first node with the wrong flags. (This could have catastrophic consequences in 1.1 because data from the two clusters could get mixed. We've added safeguards against this in 2.0 but it's still an easy way to break things)I think that we should deprecate this implicit initialization mode and make the
--join
flag mandatory when starting a node (and therefore theinit
command would be mandatory too). To avoid adding too much complexity to single-node clusters, I propose a newcockroach start-single-node
command to perform thestart
andinit
combination that is today implicit in the absence of a--join
flag.This would have a side benefit that we would know when the user intends to keep the cluster as a single node instead of adding more later. The
start-single-node
command could therefore set the replication factor to 1 to disable the "underreplicated ranges" warning (as suggested in #21429 (comment)).In some deployment environments, it's not possible to predict the addresses or hostnames that will be assigned to other nodes until they are started. This makes it difficult to set the join flag correctly on the first node (without awkward hacks like joining the first node to itself). However, in most environments this works just fine (and in fact always passing the join flag is easier in most cases than passing it sometimes but not others).
The text was updated successfully, but these errors were encountered: