Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ There are two locking aspects to dropping tables:
The exact locking behavior and duration can vary depending on
various factors:

- Which filesystem is used
- Whether the MySQL adaptive hash index is used
- Which filesystem is used.
- Whether the MySQL adaptive hash index is used.
- Whether you are attempting to hack around some of the MySQL `DROP TABLE`
performance problems using hard links
performance problems using hard links.

It is common practice to avoid direct `DROP TABLE` statements and to follow
a more elaborate table lifecycle.

## Vitess table lifecycle

The lifecycle offered by Vitess consists of the following stages or some subset:
The lifecycle offered by Vitess consists of the following stages or some subset of them:

> _in use_ -> hold -> purge -> evac -> drop -> _removed_

Expand Down Expand Up @@ -68,8 +68,8 @@ All subsets end with a `drop`, even if not explicitly mentioned. Thus, `"purge"`

In MySQL **8.0.23** and later, table drops do not acquire locks on the InnoDB buffer pool, and are non-blocking for queries that do not reference the table being dropped. Vitess automatically identifies whether the underlying MySQL server is at that version or later and will:

- Implicitly skip `purge` state, even if defined
- Implicitly skip `hold` state, even if defined
- Implicitly skip the `purge` stage, even if defined
- Implicitly skip the `evac` stage, even if defined

## Stateless flow by table name hints

Expand All @@ -82,7 +82,7 @@ Vitess does not track the state of the table lifecycle. The process is stateless

## Automated lifecycle

Vitess internally uses the above table lifecycle for [online, managed schema migrations](../../../user-guides/schema-changes/managed-online-schema-changes/). Online schema migration tools `gh-ost` and `pt-online-schema-change` create artifact tables or end with leftover tables: Vitess automatically collects those tables. The artifact or leftover tables are immediate moved to `purge` state. Depending on `--table_gc_lifecycle`, they may spend time in this state, getting purged, or immediately transitioned to the next state.
Vitess internally uses the above table lifecycle for [online, managed schema migrations](../../../user-guides/schema-changes/managed-online-schema-changes/). All online strategies: `vitess`, `gh-ost`, and `pt-online-schema-change`, create artifact tables or end with leftover tables: Vitess automatically collects those tables. The artifact or leftover tables are immediate moved to `hold` state. Depending on `--table_gc_lifecycle`, they may spend time in this state, getting purged, or immediately transitioned to the next state.

## User-facing DROP TABLE lifecycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ There are two locking aspects to dropping tables:
The exact locking behavior and duration can vary depending on
various factors:

- Which filesystem is used
- Whether the MySQL adaptive hash index is used
- Which filesystem is used.
- Whether the MySQL adaptive hash index is used.
- Whether you are attempting to hack around some of the MySQL `DROP TABLE`
performance problems using hard links
performance problems using hard links.

It is common practice to avoid direct `DROP TABLE` statements and to follow
a more elaborate table lifecycle.

## Vitess table lifecycle

The lifecycle offered by Vitess consists of the following stages or some subset:
The lifecycle offered by Vitess consists of the following stages or some subset of them:

> _in use_ -> hold -> purge -> evac -> drop -> _removed_

Expand Down Expand Up @@ -68,8 +68,8 @@ All subsets end with a `drop`, even if not explicitly mentioned. Thus, `"purge"`

In MySQL **8.0.23** and later, table drops do not acquire locks on the InnoDB buffer pool, and are non-blocking for queries that do not reference the table being dropped. Vitess automatically identifies whether the underlying MySQL server is at that version or later and will:

- Implicitly skip `purge` state, even if defined
- Implicitly skip `hold` state, even if defined
- Implicitly skip the `purge` stage, even if defined
- Implicitly skip the `evac` stage, even if defined

## Stateless flow by table name hints

Expand All @@ -82,7 +82,7 @@ Vitess does not track the state of the table lifecycle. The process is stateless

## Automated lifecycle

Vitess internally uses the above table lifecycle for [online, managed schema migrations](../../../user-guides/schema-changes/managed-online-schema-changes/). Online schema migration tools `gh-ost` and `pt-online-schema-change` create artifact tables or end with leftover tables: Vitess automatically collects those tables. The artifact or leftover tables are immediate moved to `purge` state. Depending on `--table_gc_lifecycle`, they may spend time in this state, getting purged, or immediately transitioned to the next state.
Vitess internally uses the above table lifecycle for [online, managed schema migrations](../../../user-guides/schema-changes/managed-online-schema-changes/). All online strategies: `vitess`, `gh-ost`, and `pt-online-schema-change`, create artifact tables or end with leftover tables: Vitess automatically collects those tables. The artifact or leftover tables are immediate moved to `hold` state. Depending on `--table_gc_lifecycle`, they may spend time in this state, getting purged, or immediately transitioned to the next state.

## User-facing DROP TABLE lifecycle

Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/16.0/reference/features/tablet-throttler.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ This API call returns the following JSON object:
"IsLeader": true,
"IsOpen": true,
"IsDormant": false,
"Query": "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from _vt.heartbeat",
"Threshold": 1,
"AggregatedMetrics": {
"mysql/self": {
"Value": 0.749837
Expand Down Expand Up @@ -279,6 +281,8 @@ This API call returns the following JSON object:
"IsLeader": false,
"IsOpen": true,
"IsDormant": false,
"Query": "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from _vt.heartbeat",
"Threshold": 1,
"AggregatedMetrics": {
"mysql/self": {
"Value": 0.346409
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ All subsets end with a `drop`, even if not explicitly mentioned. Thus, `"purge"`

In MySQL **8.0.23** and later, table drops do not acquire locks on the InnoDB buffer pool, and are non-blocking for queries that do not reference the table being dropped. Vitess automatically identifies whether the underlying MySQL server is at that version or later and will:

- Implicitly skip `purge` state, even if defined
- Implicitly skip `hold` state, even if defined
- Implicitly skip the `purge` stage, even if defined
- Implicitly skip the `evac` stage, even if defined

## Stateless flow by table name hints

Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/17.0/reference/features/tablet-throttler.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ This API call returns the following JSON object:
"IsLeader": true,
"IsOpen": true,
"IsDormant": false,
"Query": "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from _vt.heartbeat",
"Threshold": 1,
"AggregatedMetrics": {
"mysql/self": {
"Value": 0.749837
Expand Down Expand Up @@ -279,6 +281,8 @@ This API call returns the following JSON object:
"IsLeader": false,
"IsOpen": true,
"IsDormant": false,
"Query": "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from _vt.heartbeat",
"Threshold": 1,
"AggregatedMetrics": {
"mysql/self": {
"Value": 0.346409
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ All subsets end with a `drop`, even if not explicitly mentioned. Thus, `"purge"`

In MySQL **8.0.23** and later, table drops do not acquire locks on the InnoDB buffer pool, and are non-blocking for queries that do not reference the table being dropped. Vitess automatically identifies whether the underlying MySQL server is at that version or later and will:

- Implicitly skip `purge` state, even if defined
- Implicitly skip `hold` state, even if defined
- Implicitly skip the `purge` stage, even if defined
- Implicitly skip the `evac` stage, even if defined

## Stateless flow by table name hints

Expand Down