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

release-23.2: roachprod: split start-up script logic for disks #130119

Merged

Conversation

srosenberg
Copy link
Member

@srosenberg srosenberg commented Sep 4, 2024

Backport:

Please see individual PRs for details.

/cc @cockroachdb/release

Release justification: test-only changes

Previously, the start-up script for GCE VMs would determine if it should run by
looking at `/mnt/data1/.roachprod-initialized`. This logic fails if the disks
are ephemeral. The VM also completely fails to boot due to an `fstab` entry that
does not have the `nofail` option. Because, a new disk is attached, but it's not
formatted.

This change adds the `nofail` option, but also divides the start-up script into
parts to handle the scenario where the OS might have been previously initialed,
but the disks are not initialised. To fix this we now track OS initialization
through `/.roachprod-initialized` and disk initialization via
`/mnt/data1/.roachprod-initialized`. We also prevent the `fstab` entries from
being written again, as these are part of the OS initialization.

Fixes: cockroachdb#122094

Epic: None
Release Note: None
@srosenberg srosenberg requested a review from a team as a code owner September 4, 2024 21:55
@srosenberg srosenberg requested review from herkolategan and DarrylWong and removed request for a team September 4, 2024 21:55
Copy link

blathers-crl bot commented Sep 4, 2024

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Backports should only be created for serious
    issues
    or test-only changes.
  • Backports should not break backwards-compatibility.
  • Backports should change as little code as possible.
  • Backports should not change on-disk formats or node communication protocols.
  • Backports should not add new functionality (except as defined
    here).
  • Backports must not add, edit, or otherwise modify cluster versions; or add version gates.
  • All backports must be reviewed by the owning areas TL. For more information as to how that review should be conducted, please consult the backport
    policy
    .
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters. State changes must be further protected such that nodes running old binaries will not be negatively impacted by the new state (with a mixed version test added).
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.
  • Your backport must be accompanied by a post to the appropriate Slack
    channel (#db-backports-point-releases or #db-backports-XX-X-release) for awareness and discussion.

Also, please add a brief release justification to the body of your PR to justify this
backport.

@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Sep 4, 2024
@cockroach-teamcity
Copy link
Member

This change is Reviewable

AttachedDiskLun *int // Use attached disk, with specified LUN; Use local ssd if nil.
// TODO(DarrylWong): In the future, when all tests are run on Ubuntu 22.04, we can remove this check and default true.
// See: https://github.com/cockroachdb/cockroach/issues/112112
IsUbuntu22 bool // Allow RSA SHA1 to be used and create tcpdump symlink.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still present in the startup script, should we remove it / will it cause issues?

See below:

{{ if .IsUbuntu22 }}
sudo sh -c 'echo "PubkeyAcceptedAlgorithms +ssh-rsa" >> /etc/ssh/sshd_config'
{{ end }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I wasn't entirely sure if we had any roachtests on this branch using an older version of Ubuntu. Indeed, we do,

pkg/cmd/roachtest/tests/ruby_pg.go:		Cluster:          r.MakeClusterSpec(1, spec.UbuntuVersion(vm.FocalFossa)),
pkg/cmd/roachtest/tests/disk_stall.go:			Cluster:             r.MakeClusterSpec(4, spec.ReuseNone(), spec.DisableLocalSSD(), spec.UbuntuVersion(vm.FocalFossa)),

Reverting that change.

Previously, `Wipe` would delete the `roachprod` marker file
`.roachprod-initialized` from '/mnt/data1', that is created by the start-up
script.  This file is required by the `Wait` operation, which is required for
`SetupSSH` and others to function correctly. Hence, after running Wipe on a
cluster it becomes problematic to do some operations.

This change exclude the file from deletion.

Epic: None
Release Note: None
@srosenberg
Copy link
Member Author

TFTR!

@srosenberg srosenberg merged commit e4dab00 into cockroachdb:release-23.2 Sep 6, 2024
5 of 6 checks passed
herkolategan added a commit to herkolategan/cockroach that referenced this pull request Sep 6, 2024
fix for backport: cockroachdb#130119

/cc @cockroachdb/release

Release justification: test-only changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Label PR's that are backports to older release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants