24.6.1 - 2024-10-25

Configuration

- New feature `tier` - a group of instances with own replication factor.
  Tiers can span multiple failure domains and a single cluster can have
  multiple tiers. Going forward it will be possible to specify which
  tier a table belongs to.

- Default authentication method changed from `CHAP-SHA1` to `MD5` both for user creation and in connect CLI.
  This change affects new user creation and all system users (except the `pico_service` user), as a command-line interface of `picodata connect` and `picodata expel`. Also, default schema version at cluster boot is now `1`, not `0` as it was previously.
  Connection via `Pgproto` no longer requires additional manual step to change the authentication method. However if you use `iproto` the admin will have to manually change the authentication type.

- Support human numbers to configure memtx.memory, vinyl.memory and vinyl.cache parameters.
  Supported suffixes: K, M, G, T, 1K = 1024
  (e.g picodata run --memtx-memory 10G)

Plugins

- New ability to write custom plugins for picodata. Plugins are supposed to be written in Rust
  using our official SDK crate: `picodata-plugin`. Plugins are compiled to shared objects which
  are loaded directly into picodata process. Plugins have in-process access to various picodata API's.
  Plugins do not use special sandboxing mechanisms for maximum performance. Thus require special care
  during coding. Make sure you do not install plugins from untrusted sources.
- Plugins are able to use dedicated RPC subsystem for communication inside the cluster.
- Plugins are able to provide migrations written in SQL to define objects they need for operation.
- Plugins are cluster aware, they're deployed on entire cluster. It is possible to specify particular
  `tier` for plugins to run on.
- Plugins are managed with SQL API, i e `CREATE PLUGIN` and such. For details consult with SQL reference.

CLI

- New `picodata connect` and `picodata expel` argument `--timeout` for specifying
  the timeout for address resolving operation.

- Replace the use of `localhost` with `127.0.0.1` in `picodata run --listen` default
  value and everywhere across documentation and examples to reduce ambiguity.

RPC API

- New rpc entrypoint: `.proc_get_vshard_config` which returns the vshard configuration of tier.

- Unused types of IPROTO requests have been forbidden for the sake of integrity.
  Here is the list (all start with "IPROTO_" prefix): INSERT, REPLACE,
  UPDATE, DELETE, CALL_16, UPSERT, NOP, PREPARE, BEGIN, COMMIT, ROLLBACK.
  In future verisons, SELECT will also be forbidden.

Compatibility

- The current version is NOT compatible with prior releases. It cannot
  be started with the old snapshots

- Order of columns in `_pico_service_route` table has changed.

- Global rename
  - Config File Changes:
    - `cluster_id` renamed to `name`
    - `instance_id` renamed to `name`
    - `replicaset_id` renamed to `replicaset_name`

  - Source Code Changes:
    - `cluster_id` renamed to `cluster_name`
    - `instance_id` renamed to `instance_name`
    - `instance.instance_uuid` renamed to `instance.uuid`
    - `replicaset.replicaset_uuid` renamed to `replicaset.uuid`
    - `replicaset.replicaset_name` renamed to `replicaset.name`
    - `replicaset_id` renamed to `replicaset_name`
    - corresponding tables' columns and indexes changed accordingly

  - Environment Variable Changes:
    - `PICODATA_CLUSTER_ID` renamed to `PICODATA_CLUSTER_NAME`
    - `PICODATA_INSTANCE_ID` renamed to `PICODATA_INSTANCE_NAME`
    - `PICODATA_REPLICASET_ID` renamed to `PICODATA_REPLICASET_NAME`

- Default delimiter in `picodata connect` and `picodata admin` cli sessions is now `;`

Lua API

- Update `pico.LUA_API_VERSION`: `4.0.0` -> `5.0.0`
- The following functions removed in favor of SQL commands and RPC API
  stored procedures:
* `pico.create_table` -> [CREATE TABLE]
* `pico.drop_table` -> [DROP TABLE]
* `pico.raft_read_index` -> [.proc_read_index]
* `pico.raft_wait_index` -> [.proc_wait_index]

[CREATE TABLE]: https://docs.picodata.io/picodata/devel/reference/sql/create_table/
[DROP TABLE]: https://docs.picodata.io/picodata/devel/reference/sql/drop_table/
[.proc_read_index]: https://docs.picodata.io/picodata/devel/architecture/rpc_api/#proc_read_index
[.proc_wait_index]: https://docs.picodata.io/picodata/devel/architecture/rpc_api/#proc_wait_index

SQL

- SQL supports `LIKE` operator
- SQL supports `ILIKE` operator
- SQL supports `lower` and `upper` string functions
- Execute option `sql_vdbe_max_steps` was renamed to
`vdbe_max_steps`
- SQL supports `SELECT` statements without scans: `select 1`
- `CREATE TABLE`, `CREATE INDEX`, `CREATE PROCEDURE`, `CREATE USER` and `CREATE ROLE` support `IF NOT EXISTS` option
- `DROP TABLE`, `DROP INDEX`, `DROP PROCEDURE`, `DROP USER` and `DROP ROLE` support `IF EXISTS` option
- `CREATE TABLE`, `CREATE INDEX`, `CREATE PROCEDURE`, `DROP TABLE`, `DROP INDEX` and `DROP PROCEDURE`
  support WAIT APPLIED (GLOBALLY | LOCALLY) options, allowing users to wait for operations to be
  committed across all replicasets or only on the current one
- EXPLAIN estimates query buckets

Fixes

- Fixed bucket rebalancing for sharded tables
- Fixed panic when applying snapshot with the same index