vitess.io/vitess@v0.16.2/changelog/16.0/16.0.0/summary.md (about)

     1  ## Summary
     2  
     3  ### Table of Contents
     4  
     5  - **[Known Issues](#known-issues)**
     6    - [MySQL & Xtrabackup known issue](#mysql-xtrabackup-ddl) 
     7  - **[Major Changes](#major-changes)**
     8    - **[Breaking Changes](#breaking-changes)**
     9      - [VTGate Advertised MySQL Version](#advertised-mysql-version)
    10      - [Default MySQL version on Docker](#default-mysql-version)
    11      - [⚠️ Upgrading to this release with vitess-operator](#upgrading-to-this-release-with-vitess-operator)
    12      - [Flag Deletions and Deprecations](#flag-deletions-and-deprecations)
    13        - [VTCtld](#vtctld-flag-deletions-deprecations)
    14        - [MySQLCtl](#mysqlctl-flag-deletions-deprecations)
    15        - [VTTablet](#vttablet-flag-deletions-deprecations)
    16        - [VTBackup](#vtbackup-flag-deletions-deprecations)
    17        - [VTOrc](#vtorc-flag-deletions-deprecations)
    18      - [`lock-timeout` and `remote_operation_timeout` Changes](#lock-timeout-introduction)
    19      - [Orchestrator Integration Deletion](#orc-integration-removal)
    20      - [vtctld UI Removal](#vtcltd-ui-removal)
    21      - [Query Serving Errors](#qs-errors)
    22      - [Logstats Table and Keyspace removed](#logstats-table-keyspace)
    23      - [Removed Stats](#removed-stats)
    24      - [Deprecated Stats](#deprecated-stats)
    25      - [Normalized labels in the Prometheus Exporter](#normalized-lables)
    26    - **[Replication manager removal and VTOrc becomes mandatory](#repl-manager-removal)**
    27    - **[VReplication](#vreplication)**
    28      - [VStream Copy Resume](#vstream-copy-resume)
    29      - [VDiff2 GA](#vdiff2-ga)
    30    - **[Tablet throttler](#tablet-throttler)**
    31    - **[Incremental backup and point in time recovery](#inc-backup)**
    32    - **[New command line flags and behavior](#new-flag)**
    33      - [VTGate: Support query timeout --query-timeout](#vtgate-query-timeout)
    34      - [VTTablet: VReplication parallel insert workers --vreplication-parallel-insert-workers](#vrepl-parallel-workers)
    35      - [VTTablet: --queryserver-config-pool-conn-max-lifetime](#queryserver-lifetime)
    36      - [vttablet --throttler-config-via-topo](#vttablet-throttler-config)
    37      - [vtctldclient UpdateThrottlerConfig](#vtctldclient-update-throttler)
    38      - [vtctldclient Backup --incremental_from_pos](#vtctldclient-backup)
    39      - [vtctldclient RestoreFromBackup  --restore_to_pos](#vtctldclient-restore-from-backup)
    40      - [New `vexplain` command](#new-vexplain-command)
    41    - **[Important bug fixes](#important-bug-fixes)**
    42      - [Corrupted results for non-full-group-by queries with JOINs](#corrupted-results)
    43    - **[Deprecations and Removals](#deprecations-removals)**
    44    - **[MySQL Compatibility](#mysql-compatibility)**
    45      - [Transaction Isolation Level](#transaction-isolation-level)
    46      - [Transaction Access Mode](#transaction-access-mode)
    47      - [Support for views](#support-views)
    48    - **[VTTestServer](#vttestserver)**
    49      - [Performance Improvement](#perf-improvement)
    50  - **[Minor Changes](#minor-changes)**
    51    - **[Backup compression benchmarks](#backup-comp-benchmarks)**
    52  - **[Refactor](#refactor)**
    53    - **[VTTablet sidecar schema maintenance refactor](#vttablet-sidecar-schema)**
    54  
    55  ## <a id="known-issues"/>Known Issues
    56  
    57  ### <a id="mysql-xtrabackup-ddl"/>MySQL & Xtrabackup known issue
    58  
    59  There is a known issue with MySQL's INSTANT DDL combined with Percona XtraBackup, that affects users of Vitess 16.0.
    60  The problem is described in https://docs.percona.com/percona-xtrabackup/8.0/em/instant.html, and the immediate impact is you may not be able to backup your database using XtraBackup under certain conditions.
    61  
    62  As of MySQL 8.0.12, the default `ALGORITHM` for InnoDB's `ALTER TABLE` is `INSTANT`. In `8.0.12` only a small number of operations were eligible for `INSTANT`, but MySQL `8.0.29` added support for more common cases.
    63  Unfortunately, the changes in `8.0.29` affect XtraBackup as follows: if you `ALTER TABLE` in MySQL `8.0.29`, and that `ALTER` is eligible for `INSTANT` DDL (e.g. add new table column), then as of that moment, XtraBackup is unable to backup that table, hence your entire database.
    64  
    65  It is important to note that even if you then upgrade your MySQL server to, e.g. `8.0.32`, the table still cannot be backed up.
    66  
    67  Versions where XtraBackup is unable to backup such tables: MySQL `8.0.29` - `8.0.31`. This does not apply to Percona Server flavor.
    68  
    69  The issue is resolved with Percona XtraBackup `8.0.32` combined with MySQL `8.0.32`.
    70  
    71  You might be affected if:
    72  
    73  - You're using MySQL `8.0.29` - `8.0.31` and are using XtraBackup to backup your database
    74  - and, you have issued an `ALTER TABLE`, either directly, or using Online DDL in vitess `v16.0` and below
    75  
    76  A futures Vitess patch release `v16.0.1` will address the issue via Online DDL migrations.
    77  
    78  #### Mitigations
    79  
    80  - Use Percona XtraBackup `8.0.32` combined with MySQL `8.0.32`. To go with this option, you can use the docker image `vitess/lite:v16.0.0-mysql-8.0.32`.
    81  - or, Use a Percona Server flavor
    82  - or, always ensure to add `ALGORITHM=INPLACE` or `ALGORITHM=COPY` to your `ALTER TABLE` statements
    83  
    84  #### Workarounds
    85  
    86  If you have already been affected, these are the options to be able to backup your database:
    87  
    88  - Use `builtin` backups, see https://vitess.io/docs/15.0/user-guides/operating-vitess/backup-and-restore/creating-a-backup/. `builting` backups are not based on XtraBackup.
    89  - Upgrade to MySQL `8.0.32` or above and to Xtrabackup `8.0.32`, or switch to Percona Server. To go with this option, you can use the docker image `vitess/lite:v16.0.0-mysql-8.0.32`. Then rebuild the table directly via:
    90    - `OPTIMIZE TABLE your_table`
    91    - or, `ALTER TABLE your_table ENGINE=INNOB`
    92  - Upgrade to Vitess patch release `v16.0.1`, upgrade to MySQL `8.0.32` or above and to Xtrabackup `8.0.32`, or switch to Percona Server, and rebuild the table via Online DDL:
    93  ```shell
    94  $ vtctldclient ApplySchema --skip_preflight --ddl_strategy "vitess" --sql "ALTER TABLE your_table ENGINE=InnoDB" your_keyspace
    95  ```
    96  or
    97  ```sql
    98  > SET @@ddl_strategy='vitess';
    99  > ALTER TABLE your_table ENGINE=InnoDB;
   100  ```
   101  
   102  ## <a id="major-changes"/>Major Changes
   103  
   104  ### <a id="breaking-changes"/>Breaking Changes
   105  
   106  #### <a id="advertised-mysql-version"/>VTGate Advertised MySQL Version
   107  
   108  Since [Pull Request #11989](https://github.com/vitessio/vitess/pull/11989), VTGate advertises MySQL version 8.0.30. This is a breaking change for clients that rely on the VTGate advertised MySQL version and still use MySQL 5.7.
   109  The users can set the `mysql_server_version` flag to advertise the correct version.
   110  
   111  It is worth noting that [the feature to avoid using reserved connections](https://vitess.io/docs/16.0/reference/query-serving/reserved-conn/#avoiding-the-use-of-reserved-connections) depends on the `mysql_server_version` CLI flag, which default value has been changed from `5.7.9-vitess` to `8.0.30-vitess`. We recommend that users running MySQL 5.7 set vtgate's `mysql_server_version` CLI flag to `5.7.9-vitess` to prevent the queries from being unexpectedly rewritten.
   112  
   113  #### <a id="default-mysql-version"/>Default MySQL version on Docker
   114  
   115  The default major MySQL version used by our `vitess/lite:latest` image is going from `5.7` to `8.0`. Additionally, the patch version of MySQL80 has been upgraded from `8.0.23` to `8.0.30`.
   116  This change was brought by [Pull Request #12252](https://github.com/vitessio/vitess/pull/12252).
   117  
   118  #### <a id="upgrading-to-this-release-with-vitess-operator"/>⚠️Upgrading to this release with vitess-operator
   119  
   120  If you are using the vitess-operator and want to remain on MySQL 5.7, **you are required** to use the `vitess/lite:v16.0.0-mysql57` Docker Image, otherwise the `vitess/lite:v16.0.0` image will be on MySQL 80.
   121  
   122  However, if you are running MySQL 8.0 on the vitess-operator, with for instance `vitess/lite:v15.0.2-mysql80`, considering that we are bumping the patch version of MySQL 80 from `8.0.23` to `8.0.30`, you will have to manually upgrade:
   123  
   124  1. Add `innodb_fast_shutdown=0` to your extra cnf in your YAML file.
   125  2. Apply this file.
   126  3. Wait for all the pods to be healthy.
   127  4. Then change your YAML file to use the new Docker Images (`vitess/lite:v16.0.0`, defaults to mysql80).
   128  5. Remove `innodb_fast_shutdown=0` from your extra cnf in your YAML file.
   129  6. Apply this file.
   130  
   131  #### <a id="flag-deletions-and-deprecations"\>Flag Deletions and Deprecations
   132  
   133  ##### <a id="vtctld-flag-deletions-deprecations"/>VTCtld
   134  With the removal of the vtctld UI, the following vtctld flags have been deprecated:
   135  - `--vtctld_show_topology_crud`: This was a flag that controlled the display of CRUD topology actions in the vtctld UI. The UI is removed, so this flag is no longer necessary.
   136  
   137  The following deprecated flags have also been removed:
   138  - `--enable_realtime_stats`
   139  - `--enable_vtctld_ui`
   140  - `--web_dir`
   141  - `--web_dir2`
   142  - `--workflow_manager_init`
   143  - `--workflow_manager_use_election`
   144  - `--workflow_manager_disable`
   145  
   146  ##### <a id="mysqlctl-flag-deletions-deprecations"/>MySQLCtld
   147  
   148  The [`mysqlctl` command-line client](https://vitess.io/docs/16.0/reference/programs/mysqlctl/) had some leftover (ignored) server flags after the [v15 pflag work](https://github.com/vitessio/enhancements/blob/main/veps/vep-4.md). Those unused flags have now been removed. If you are using any of the following flags with `mysqlctl` in your scripts or other tooling, they will need to be removed prior to upgrading to v16:
   149  `--port --grpc_auth_static_client_creds --grpc_compression --grpc_initial_conn_window_size --grpc_initial_window_size --grpc_keepalive_time --grpc_keepalive_timeout`
   150  
   151  ##### <a id="vttablet-flag-deletions-deprecations"/>VTTablet
   152  
   153  The following flags were removed in v16:
   154  - `--enable_semi_sync`
   155  - `--backup_storage_hook`, use one of the builtin compression algorithms or `--external-compressor` and `--external-decompressor` instead.
   156  - `--init_populate_metadata`, since we have deleted the `local_metadata` and `shard_metadata` sidecar database tables.
   157  
   158  The flag `--disable-replication-manager` is deprecated and will be removed in a future release.
   159  
   160  ##### <a id="vtbackup-flag-deletions-deprecations"/>VTBackup
   161  
   162  The VTBackup flag `--backup_storage_hook` has been removed, use one of the builtin compression algorithms or `--external-compressor` and `--external-decompressor` instead.
   163  
   164  
   165  ##### <a id="vtorc-flag-deletions-deprecations"/>VTOrc
   166  
   167  The flag `--lock-shard-timeout` has been deprecated. Please use the newly introduced `--lock-timeout` flag instead. More detail [here](#lock-timeout-introduction).
   168  
   169  #### <a id="lock-timeout-introduction"/>`lock-timeout` and `remote_operation_timeout` Changes
   170  
   171  Before the changes made in [Pull Request #11881](https://github.com/vitessio/vitess/pull/11881), the shard and keyspace locks used to be capped by the `remote_operation_timeout`. This is no longer the case and instead a new flag called `lock-timeout` is introduced.
   172  For backward compatibility, if `lock-timeout` is unspecified and `remote_operation_timeout` flag is provided, then its value will also be used for `lock-timeout`.
   173  The default value for `remote_operation_timeout` has also changed from 30 seconds to 15 seconds. The default for the new flag `lock-timeout` is 45 seconds.
   174  
   175  During upgrades, if the users want to preserve the same behaviour as previous releases, then they should provide the `remote_operation_timeout` flag explicitly before upgrading.
   176  After the upgrade, they should then alter their configuration to also specify `lock-timeout` explicitly.
   177  
   178  #### <a id="orc-integration-removal"/>Orchestrator Integration Deletion
   179  
   180  Orchestrator integration in `vttablet` was deprecated in the previous release and is deleted in this release.
   181  `VTOrc` should be deployed instead. You can read more on [how VTOrc is designed](https://vitess.io/docs/16.0/reference/vtorc/) and on [how to run VTOrc in production](https://vitess.io/docs/16.0/user-guides/configuration-basic/vtorc/).
   182  
   183  #### <a id="vtcltd-ui-removal"/>vtctld web UI Removal
   184  In v13, the vtctld UI was deprecated. As of this release, the `web/vtctld2` directory is deleted and the UI will no longer be included in any Vitess images going forward. All build scripts and the Makefile have been updated to reflect this change, which was done in [Pull Request #11851](https://github.com/vitessio/vitess/pull/11851)
   185  
   186  However, the vtctld HTTP API will remain at `{$vtctld_web_port}/api`.
   187  
   188  #### <a id="qs-errors"/>Query Serving Errors
   189  
   190  In [Pull Request #10738](https://github.com/vitessio/vitess/pull/10738) we are introducing a new way to report errors from Vitess through the query interface.
   191  Errors will now have an error code for each error, which will make it easy to search for more information on the issue.
   192  For instance, the following error:
   193  
   194  ```
   195  aggregate functions take a single argument 'count(user_id, name)'
   196  ```
   197  
   198  Will be transformed into:
   199  
   200  ```
   201  VT03001: aggregate functions take a single argument 'count(user_id, name)'
   202  ```
   203  
   204  The error code `VT03001` can then be used to search or ask for help and report problems.
   205  
   206  If you have code searching for error strings from Vitess, this is a breaking change.
   207  Many error strings have been tweaked.
   208  If your application is searching for specific errors, you might need to update your code.
   209  
   210  #### <a id="logstats-table-keyspace"/>Logstats Table and Keyspace removed
   211  
   212  Information about which tables are used is now reported by the field TablesUsed added in v15, that is a string array, listing all tables and which keyspace they are in.
   213  The Table/Keyspace fields were deprecated in v15 and are now removed in the v16 release, more information can be found on [Pull Request #12083](https://github.com/vitessio/vitess/pull/12083).
   214  
   215  #### <a id="removed-stats"/>Removed Stats
   216  
   217  The stat `QueryRowCounts` is removed in v16 as part of [Pull Request #12083](https://github.com/vitessio/vitess/pull/12083). `QueryRowsAffected` and `QueryRowsReturned` can be used instead to gather the same information.
   218  
   219  #### <a id="deprecated-stats"/>Deprecated Stats
   220  
   221  The stats `QueriesProcessed` and `QueriesRouted` are deprecated in v16 as part of [Pull Request #12083](https://github.com/vitessio/vitess/pull/12083). The same information can be inferred from the stats `QueriesProcessedByTable` and `QueriesRoutedByTable` respectively. These stats will be removed in the next release.
   222  
   223  #### <a id="normalized-lables"/>Normalized labels in the Prometheus Exporter
   224  
   225  The Prometheus metrics exporter now properly normalizes _all_ label names into their `snake_case` form, as it is idiomatic for Prometheus metrics. Previously, Vitess instances were emitting inconsistent labels for their metrics, with some of them being `CamelCase` and others being `snake_case`.
   226  More information about this change can be found on [Pull Request #12057](https://github.com/vitessio/vitess/pull/12057).
   227  
   228  For example, `vtgate_topology_watcher_errors{Operation="GetTablet"} 0` will become `vtgate_topology_watcher_errors{operation="GetTablet"} 0`
   229  
   230  Some more of these changes are listed here -
   231  
   232  | Previous metric                                             | New Metric                                                  |
   233  |-------------------------------------------------------------|-------------------------------------------------------------|
   234  | vtgate_topology_watcher_operations{Operation="AddTablet"}   | vtgate_topology_watcher_operations{operation="AddTablet"}   |
   235  | vtgate_queries_processed{Plan="Reference"}                  | vtgate_queries_processed{plan="Reference"}                  |
   236  | vtgate_queries_routed{Plan="Reference"}                     | vtgate_queries_routed{plan="Reference"}                     |
   237  | vttablet_table_allocated_size{Table="corder"}               | vttablet_table_allocated_size{table="corder"}               |
   238  | vttablet_table_file_size{Table="corder"}                    | vttablet_table_file_size{table="corder"}                    |
   239  | vttablet_topology_watcher_errors{Operation="GetTablet"}     | vttablet_topology_watcher_errors{operation="GetTablet"}     |
   240  | vttablet_topology_watcher_operations{Operation="AddTablet"} | vttablet_topology_watcher_operations{operation="AddTablet"} |
   241  
   242  ### <a id="repl-manager-removal"/>Replication manager removal and VTOrc becomes mandatory
   243  VTOrc is now a **required** component of Vitess starting from v16. If the users want Vitess to manage replication, then they must run VTOrc.
   244  Replication manager is removed from vttablets since the responsibility of fixing replication lies entirely with VTOrc now.
   245  The flag `disable-replication-manager` is deprecated and will be removed in a future release.
   246  
   247  ### <a id="vreplication"/>VReplication
   248  
   249  #### <a id="vstream-copy-resume"/>VStream Copy Resume
   250  
   251  In [Pull Request #11103](https://github.com/vitessio/vitess/pull/11103) we introduced the ability to resume a `VTGate` [`VStream` copy operation](https://vitess.io/docs/16.0/reference/vreplication/vstream/). This is useful when a [`VStream` copy operation](https://vitess.io/docs/16.0/reference/vreplication/vstream/) is interrupted due to e.g. a network failure or a server restart. The `VStream` copy operation can be resumed by specifying each table's last seen primary key value in the `VStream` request. Please see the [`VStream` docs](https://vitess.io/docs/16.0/reference/vreplication/vstream/) for more details.
   252  
   253  #### <a id="vdiff2-ga"/>VDiff2 GA
   254  
   255  We are marking [VDiff v2](https://vitess.io/docs/16.0/reference/vreplication/vdiff2/) as production-ready in v16. We now recommend that you use v2 rather than v1 going forward. V1 will be deprecated and eventually removed in future releases.
   256  If you wish to use v1 for any reason, you will now need to specify the `--v1` flag.
   257  
   258  ### <a id="tablet-throttler"/>Tablet throttler
   259  
   260  The tablet throttler can now be configured dynamically. Configuration is now found in the topo service, and applies to all tablets in all shards and cells of a given keyspace.
   261  It is possible to enable or disable throttling, and to change the throttling threshold as well as the throttler query.
   262  
   263  Please note that this feature is considered experimental in this release. For backwards compatibility `v16` still supports `vttablet`-based command line flags for throttler configuration.
   264  
   265  More information can be found on [Pull Request #11604](https://github.com/vitessio/vitess/pull/11604).
   266  
   267  ### <a id="inc-backup"/>Incremental backup and point in time recovery
   268  
   269  In [Pull Request #11097](https://github.com/vitessio/vitess/pull/11097) we introduced native incremental backup and point in time recovery:
   270  
   271  - It is possible to take an incremental backup, starting with last known (full or incremental) backup, and up to either a specified (GTID) position, or current ("auto") position.
   272  - The backup is done by copying binary logs. The binary logs are rotated as needed.
   273  - It is then possible to restore a backup up to a given point in time (GTID position). This involves finding a restore path consisting of a full backup and zero or more incremental backups, applied up to the given point in time.
   274  - A server restored to a point in time remains in `DRAINED` tablet type, and does not join the replication stream (thus, "frozen" in time).
   275  - It is possible to take incremental backups from different tablets. It is OK to have overlaps in incremental backup contents. The restore process chooses a valid path, and is valid as long as there are no gaps in the backed up binary log content.
   276  
   277  ### <a id="new-flag"/>New command line flags and behavior
   278  
   279  #### <a id="vtgate-query-timeout"/>VTGate: Support query timeout --query-timeout
   280  
   281  `--query-timeout` allows you to specify a timeout for queries. This timeout is applied to all queries.
   282  It can be overridden by setting the `query_timeout` session variable.
   283  Setting it as query comment directive with `QUERY_TIMEOUT_MS` will override other values.
   284  
   285  #### <a id="vrepl-parallel-workers"/>VTTablet: VReplication parallel insert workers --vreplication-parallel-insert-workers
   286  
   287  `--vreplication-parallel-insert-workers=[integer]` enables parallel bulk inserts during the copy phase
   288  of VReplication (disabled by default). When set to a value greater than 1 the bulk inserts — each
   289  executed as a single transaction from the vstream packet contents — may happen in-parallel and
   290  out-of-order, but the commit of those transactions are still serialized in order.
   291  
   292  Other aspects of the VReplication copy-phase logic are preserved:
   293  
   294    1. All statements executed when processing a vstream packet occur within a single MySQL transaction.
   295    2. Writes to `_vt.copy_state` always follow their corresponding inserts from within the vstream packet.
   296    3. The final `commit` for the vstream packet always follows the corresponding write to `_vt.copy_state`.
   297    4. The vstream packets are committed in the order seen in the stream. So for any PK1 and PK2, the write to `_vt.copy_state` and  `commit` steps (steps 2 and 3 above) for PK1 will both precede the `_vt.copy_state` write and commit steps of PK2.
   298  
   299   Other phases, catchup, fast-forward, and replicating/"running", are unchanged.
   300  
   301  #### <a id="queryserver-lifetime"/>VTTablet: --queryserver-config-pool-conn-max-lifetime
   302  
   303  `--queryserver-config-pool-conn-max-lifetime=[integer]` allows you to set a timeout on each connection in the query server connection pool. It chooses a random value between its value and twice its value, and when a connection has lived longer than the chosen value, it'll be removed from the pool the next time it's returned to the pool.
   304  
   305  #### <a id="vttablet-throttler-config"/>vttablet --throttler-config-via-topo
   306  
   307  The flag `--throttler-config-via-topo` switches throttler configuration from `vttablet`-flags to the topo service. This flag is `false` by default, for backwards compatibility. It will default to `true` in future versions.
   308  
   309  #### <a id="vtctldclient-update-throttler"/>vtctldclient UpdateThrottlerConfig
   310  
   311  Tablet throttler configuration is now supported in `topo`. Updating the throttler configuration is done via `vtctldclient UpdateThrottlerConfig` and applies to all tablet in all cells for a given keyspace.
   312  
   313  Examples:
   314  
   315  ```shell
   316  # disable throttler; all throttler checks will return with "200 OK"
   317  $ vtctldclient UpdateThrottlerConfig --disable commerce
   318  
   319  # enable throttler; checks are responded with appropriate status per current metrics
   320  $ vtctldclient UpdateThrottlerConfig --enable commerce
   321  
   322  # Both enable and set threshold in same command. Since no query is indicated, we assume the default check for replication lag
   323  $ vtctldclient UpdateThrottlerConfig --enable --threshold 5.0 commerce
   324  
   325  # Change threshold. Does not affect enabled/disabled state of the throttler
   326  $ vtctldclient UpdateThrottlerConfig --threshold 1.5 commerce
   327  
   328  # Use a custom query
   329  $ vtctldclient UpdateThrottlerConfig --custom_query "show global status like 'threads_running'" --check_as_check_self --threshold 50 commerce
   330  
   331  # Restore default query and threshold
   332  $ vtctldclient UpdateThrottlerConfig --custom_query "" --check_as_check_shard --threshold 1.5 commerce
   333  ```
   334  
   335  See https://github.com/vitessio/vitess/pull/11604
   336  
   337  #### <a id="vtctldclient-backup"/>vtctldclient Backup --incremental_from_pos
   338  
   339  The `Backup` command now supports `--incremental_from_pos` flag, which can receive a valid position or the value `auto`. For example:
   340  
   341  ```shell
   342  $ vtctlclient -- Backup --incremental_from_pos "MySQL56/16b1039f-22b6-11ed-b765-0a43f95f28a3:1-615" zone1-0000000102
   343  $ vtctlclient -- Backup --incremental_from_pos "auto" zone1-0000000102
   344  ```
   345  
   346  When the value is `auto`, the position is evaluated as the last successful backup's `Position`. The idea with incremental backups is to create a contiguous (overlaps allowed) sequence of backups that store all changes from last full backup.
   347  
   348  The incremental backup copies binary log files. It does not take MySQL down nor places any locks. It does not interrupt traffic on the MySQL server. The incremental backup copies complete binlog files. It initially rotates binary logs, then copies anything from the requested position and up to the last completed binary log.
   349  
   350  The backup thus does not necessarily start _exactly_ at the requested position. It starts with the first binary log that has newer entries than requested position. It is OK if the binary logs include transactions prior to the requested position. The restore process will discard any duplicates.
   351  
   352  Normally, you can expect the backups to be precisely contiguous. Consider an `auto` value: due to the nature of log rotation and the fact we copy complete binlog files, the next incremental backup will start with the first binay log not covered by the previous backup, which in itself copied the one previous binlog file in full. Again, it is completely valid to enter any good position.
   353  
   354  The incremental backup fails if it is unable to attain binary logs from given position (ie binary logs have been purged).
   355  
   356  The manifest of an incremental backup has a non-empty `FromPosition` value, and a `Incremental = true` value.
   357  
   358  #### <a id="vtctldclient-restore-from-backup"/>vtctldclient RestoreFromBackup  --restore_to_pos
   359  
   360  - `--restore_to_pos`: request to restore the server up to the given position (inclusive) and not one step further.
   361  - `--dry_run`:        when `true`, calculate the restore process, if possible, evaluate a path, but exit without actually making any changes to the server.
   362  
   363  Examples:
   364  
   365  ```shell
   366  $ vtctlclient -- RestoreFromBackup  --restore_to_pos  "MySQL56/16b1039f-22b6-11ed-b765-0a43f95f28a3:1-220" zone1-0000000102
   367  ```
   368  
   369  The restore process seeks a restore _path_: a sequence of backups (handles/manifests) consisting of one full backup followed by zero or more incremental backups, that can bring the server up to the requested position, inclusive.
   370  
   371  The command fails if it cannot evaluate a restore path. Possible reasons:
   372  
   373  - there's gaps in the incremental backups
   374  - existing backups don't reach as far as requested position
   375  - all full backups exceed requested position (so there's no way to get into an ealier position)
   376  
   377  The command outputs the restore path.
   378  
   379  There may be multiple restore paths, the command prefers a path with the least number of backups. This has nothing to say about the amount and size of binary logs involved.
   380  
   381  The `RestoreFromBackup  --restore_to_pos` ends with:
   382  
   383  - the restored server in intentionally broken replication setup
   384  - tablet type is `DRAINED`
   385  
   386  #### <a id="new-vexplain-command"/>New `vexplain` command
   387  A new `vexplain` command has been introduced with the following syntax:
   388  ```
   389  VEXPLAIN [ALL|QUERIES|PLAN] explainable_stmt
   390  ```
   391  
   392  This command will help users look at the plan that vtgate comes up with for the given query (`PLAN` type), see all the queries that are executed on all the MySQL instances (`QUERIES` type), and see the vtgate plan along with the MySQL explain output for the executed queries (`ALL` type).
   393  
   394  The formats `VTEXPLAIN` and `VITESS` for `EXPLAIN` queries are deprecated, and these newly introduced commands should be used instead.
   395  
   396  ### <a id="important-bug-fixes"/>Important bug fixes
   397  
   398  #### <a id="corrupted-results"/>Corrupted results for non-full-group-by queries with JOINs
   399  
   400  An issue in versions `<= v14.0.3` and `<= v15.0.0` that generated corrupted results for non-full-group-by queries with a JOIN
   401  is now fixed. The full issue can be found [here](https://github.com/vitessio/vitess/issues/11625), and its fix [here](https://github.com/vitessio/vitess/pull/11633).
   402  
   403  ### <a id="deprecations-removals"/>Deprecations and Removals
   404  
   405  - The V3 planner is deprecated as of the v16 release, and will be removed in the v17 release of Vitess.
   406  
   407  - The [VReplication v1 commands](https://vitess.io/docs/15.0/reference/vreplication/v1/) — which were deprecated in Vitess 11.0 — have been removed. You will need to use the [VReplication v2 commands](https://vitess.io/docs/16.0/reference/vreplication/v2/) instead.
   408  
   409  - The `vtctlclient VExec` command was removed, having been deprecated since v12.
   410  
   411  - The `vtctlclient VReplicationExec` command has now been deprecated and will be removed in a future release. Please see [#12070](https://github.com/vitessio/vitess/pull/12070) for additional details.
   412  
   413  - `vtctlclient OnlineDDL ... [complete|retry|cancel|cancel-all]` returns empty result on success instead of number of shard affected.
   414  
   415  - The dead legacy Workflow Manager related code was removed in [#12085](https://github.com/vitessio/vitess/pull/12085). This included the following `vtctl` client commands: `WorkflowAction`, `WorkflowCreate`, `WorkflowWait`, `WorkflowStart`, `WorkflowStop`, `WorkflowTree`, `WorkflowDelete`.
   416  
   417  - VTAdmin's `VTExplain` endpoint has been deprecated. Users can use the new `vexplain` query format instead. The endpoint will be deleted in a future release.
   418  
   419  ### <a id="mysql-compatibility"/>MySQL Compatibility
   420  
   421  #### <a id="transaction-isolation-level"/>Transaction Isolation Level
   422  
   423  In [Pull Request #11704](https://github.com/vitessio/vitess/pull/11704) we are adding support for `set [session] transaction isolation level <transaction_characteristic>`
   424  
   425  ```sql
   426  transaction_characteristic: {
   427      ISOLATION LEVEL level
   428    | access_mode
   429  }
   430  
   431  level: {
   432       REPEATABLE READ
   433     | READ COMMITTED
   434     | READ UNCOMMITTED
   435     | SERIALIZABLE
   436  }
   437  ```
   438  
   439  This will set the transaction isolation level for the current session.
   440  This will be applied to any shard where the session will open a transaction.
   441  
   442  #### <a id="transaction-access-mode"/>Transaction Access Mode
   443  
   444  In [Pull Request #11704](https://github.com/vitessio/vitess/pull/11704) we are adding support for `start transaction` with transaction characteristic.
   445  
   446  ```sql
   447  START TRANSACTION
   448      [transaction_characteristic [, transaction_characteristic] ...]
   449  
   450  transaction_characteristic: {
   451      WITH CONSISTENT SNAPSHOT
   452    | READ WRITE
   453    | READ ONLY
   454  }
   455  ```
   456  
   457  This will allow users to start a transaction with these characteristics.
   458  
   459  #### <a id="support-views"/>Support For Views
   460  
   461  Views sharded support is released as an experimental feature in `v16.0.0`.
   462  Views are not enabled by default in your Vitess cluster, but they can be turned on using the `--enable-views` flag on VTGate, and `--queryserver-enable-views` flag on VTTablet.
   463  
   464  To read more on how views are implemented you can read the [Views Support RFC](https://github.com/vitessio/vitess/issues/11559).
   465  And if you want to learn more on how to use views and its current limitations, you can read the [Views Documentation](https://vitess.io/docs/16.0/reference/compatibility/mysql-compatibility/#views).
   466  
   467  ### <a id="vttestserver"/>VTTestServer
   468  
   469  #### <a id="perf-improvement"/>Performance Improvement
   470  
   471  Creating a database with vttestserver was taking ~45 seconds. This can be problematic in test environments where testcases do a lot of `create` and `drop` database.
   472  In an effort to minimize the database creation time, in [Pull Request #11918](https://github.com/vitessio/vitess/pull/11918) we have changed the value of `tablet_refresh_interval` to 10s while instantiating vtcombo during vttestserver initialization. We have also made this configurable so that it can be reduced further if desired.
   473  For any production cluster the default value of this flag is still [1 minute](https://vitess.io/docs/16.0/reference/programs/vtgate/). Reducing this value might put more stress on Topo Server (since we now read from Topo server more often) but for testing purposes
   474  this shouldn't be a concern.
   475  
   476  ## <a id="minor-changes"/>Minor changes
   477  
   478  ### <a id="backup-comp-benchmarks"/>Backup Compression Benchmarks
   479  
   480  Compression benchmarks have been added to the `mysqlctl` package.
   481  
   482  The benchmarks fetch and compress a ~6 GiB tar file containing 3 InnoDB files using different built-in and external compressors.
   483  
   484  Here are sample results from a 2020-era Mac M1 with 16 GiB of memory:
   485  
   486  ```sh
   487  $ go test -bench=BenchmarkCompress ./go/vt/mysqlctl -run=NONE -timeout=12h -benchtime=1x -v
   488  goos: darwin
   489  goarch: arm64
   490  pkg: vitess.io/vitess/go/vt/mysqlctl
   491  BenchmarkCompressLz4Builtin
   492      compression_benchmark_test.go:310: downloading data from https://www.dropbox.com/s/raw/smmgifsooy5qytd/enwiki-20080103-pages-articles.ibd.tar.zst
   493      BenchmarkCompressLz4Builtin-8                  1        11737493087 ns/op        577.98 MB/s             2.554 compression-ratio
   494      BenchmarkCompressPargzipBuiltin
   495      BenchmarkCompressPargzipBuiltin-8              1        31083784040 ns/op        218.25 MB/s             2.943 compression-ratio
   496      BenchmarkCompressPgzipBuiltin
   497      BenchmarkCompressPgzipBuiltin-8                1        13325299680 ns/op        509.11 MB/s             2.910 compression-ratio
   498      BenchmarkCompressZstdBuiltin
   499      BenchmarkCompressZstdBuiltin-8                 1        18683863911 ns/op        363.09 MB/s             3.150 compression-ratio
   500      BenchmarkCompressZstdExternal
   501      BenchmarkCompressZstdExternal-8                1        10795487675 ns/op        628.41 MB/s             3.093 compression-ratio
   502      BenchmarkCompressZstdExternalFast4
   503      BenchmarkCompressZstdExternalFast4-8           1        7139319009 ns/op         950.23 MB/s             2.323 compression-ratio
   504      BenchmarkCompressZstdExternalT0
   505      BenchmarkCompressZstdExternalT0-8              1        4393860434 ns/op        1543.97 MB/s             3.093 compression-ratio
   506      BenchmarkCompressZstdExternalT4
   507      BenchmarkCompressZstdExternalT4-8              1        4389559744 ns/op        1545.49 MB/s             3.093 compression-ratio
   508      PASS
   509      cleaning up "/var/folders/96/k7gzd7q10zdb749vr02q7sjh0000gn/T/ee7d47b45ef09786c54fa2d7354d2a68.dat"
   510  ```
   511  
   512  ## <a id="refactor"/>Refactor
   513  
   514  ### <a id="vttablet-sidecar-schema"/>VTTablet Sidecar Schema Maintenance Refactor
   515  
   516  This is an internal refactor and should not change the behavior of Vitess as seen by users. 
   517  
   518  Developers will see a difference though: v16 changes the way we maintain vttablet's sidecar database schema (also referred to as the `_vt`
   519  database). Instead of using the `WithDDL` package, introduced in [PR #6348](https://github.com/vitessio/vitess/pull/6348), we use a
   520  declarative approach. Developers will now have to update the desired schema in the `go/vt/sidecardb/schema` directory.
   521  
   522  The desired schema is specified, one per table. A new module `sidecardb`, compares this to the existing schema and
   523  performs the required `create` or `alter` to reach it. This is done whenever a primary vttablet starts up.
   524  
   525  The sidecar tables `local_metadata` and `shard_metadata` are no longer in use and all references to them are removed as
   526  part of this refactor. They were used previously for Orchestrator support, which has been superseded by `vtorc`.