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

Prevent overwriting existing host_uuid file #48012

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Oct 28, 2024

In some circumstances, multiple Teleport processes may be trying to write the host_uuid file in the same data directory simultaneously. The last of the writers would win, and any process using a host UUID that did not match what ended up on disk could get into a perpetual state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no longer a blind upsert. Instead, special care is taken to ensure that there can only be a single writer, and that any subsequent updates to the file are aborted and the first value written is used instead.

changelog: Prevent two Teleport processes from overwriting the same host_uuid file.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-48012.d3pp5qlev8mo18.amplifyapp.com

@rosstimothy rosstimothy force-pushed the tross/opt_locking_host_uuid branch 9 times, most recently from 60e9638 to 80d0880 Compare October 29, 2024 21:47
lib/utils/utils.go Outdated Show resolved Hide resolved
lib/utils/utils.go Outdated Show resolved Hide resolved
@rosstimothy rosstimothy force-pushed the tross/opt_locking_host_uuid branch 3 times, most recently from 8c06967 to 94e1b7e Compare October 30, 2024 21:37
@rosstimothy rosstimothy marked this pull request as ready for review October 31, 2024 16:12
@github-actions github-actions bot added size/md tctl tctl - Teleport admin tool labels Oct 31, 2024
lib/utils/hostid/hostid.go Outdated Show resolved Hide resolved
lib/utils/hostid/hostid.go Outdated Show resolved Hide resolved
lib/utils/hostid/hostid.go Outdated Show resolved Hide resolved
lib/utils/hostid/hostid.go Outdated Show resolved Hide resolved
lib/utils/hostid/hostid.go Outdated Show resolved Hide resolved
@rosstimothy rosstimothy force-pushed the tross/opt_locking_host_uuid branch 2 times, most recently from edced75 to 54add95 Compare October 31, 2024 17:23
@rosstimothy rosstimothy force-pushed the tross/opt_locking_host_uuid branch 3 times, most recently from 4020b89 to dcb3e7c Compare November 4, 2024 22:06
@rosstimothy rosstimothy enabled auto-merge November 4, 2024 22:06
@rosstimothy rosstimothy added this pull request to the merge queue Nov 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 4, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
@rosstimothy rosstimothy force-pushed the tross/opt_locking_host_uuid branch from dcb3e7c to 8584fba Compare November 4, 2024 22:37
@rosstimothy rosstimothy enabled auto-merge November 4, 2024 22:37
@rosstimothy rosstimothy added this pull request to the merge queue Nov 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 4, 2024
@rosstimothy rosstimothy added this pull request to the merge queue Nov 5, 2024
Merged via the queue into master with commit c9a7fce Nov 5, 2024
40 checks passed
@rosstimothy rosstimothy deleted the tross/opt_locking_host_uuid branch November 5, 2024 14:18
@public-teleport-github-review-bot

@rosstimothy See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Failed

rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
rosstimothy added a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2024
In some circumstances, multiple Teleport processes may be trying
to write the host_uuid file in the same data directory simultaneously.
The last of the writers would win, and any process using a host
UUID that did not match what ended up on disk could get into a perpertual
state of being unable to connect to the cluster.

To avoid the raciness, the host_uuid file writing process is no
longer a blind upsert. Instead, special care is taken to ensure
that there can only be a single writer, and that any subsequent
updates to the file are aborted and the first value written is
used instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants