Skip to main content
Version: 0.15.0

Upgrading to 0.15

Coming from 0.13.x or earlier, first apply Upgrading to 0.14.

From 0.14.x to 0.15.0​

0.15.0 upgrades directly from 0.10.0 or later and rolls back to 0.14.2 without a restore of the control-plane database. No catalog migrates. A rollback also takes the nodes back: run the previous node image (or qod fleet join) and restart every node, as a node of this release refuses the session handles of an earlier manager.

Checklist​

Before upgrading

  1. Review the column masks of every column that is not text. A mask now applies only when its result has exactly its column's type; otherwise every read of the column is refused. See Masks keep their column's type.
  2. Find the users who write to tables their own policies cover. A user holding a column or a row policy on a table can no longer write it, INSERT included. Give loaders a role with no policy on the tables they load. See Column and row policies run on the node.

While upgrading

  1. Upgrade every manager replica together with its nodes. Column and row policies run only on qod-node, at node protocol 10 with signed session handles of version 8, and a node of another protocol refuses this release's handles. On Kubernetes that means the new node image; fleet servers need this release's qod fleet join, which bundles its qod-node.

After upgrading

  1. Restart every node, so that it runs DuckDB 2.0.1 and node protocol 10. A node an earlier release started keeps running until it restarts, and is never routed to.
  2. Remove the retired settings. QOD_CLS_ENFORCEMENT, QOD_CLS_UNRESOLVED_TABLE and QOD_RLS_ENFORCEMENT (and their quack-on-demand.cls / quack-on-demand.rls keys) no longer exist and are ignored. QOD_CLS_ENABLED=false and QOD_RLS_ENABLED=false remain the kill switches; give them the same value on every replica.
  3. Read the boot output and fix each policy it names. See Boot reports.
  4. Tell users of DuckDB 2.0.1 clients to drop READ_ONLY from their ATTACH 'quack:...'. See DuckDB 2.0.1.

Column and row policies run on the node​

The manager no longer rewrites a statement to apply a mask or a row filter. It signs each session's applicable policies into a policy snapshot, and qod-node applies them to DuckDB's bound plan: a mask or a deny at every scan of the column it covers, a row filter at every scan of the table its policy names, through views and secure views. Statements run as written, so their result column names are DuckDB's own. What it changes for a user holding a policy:

  • Writes to a covered table are refused, INSERT included: QoD: writes to a row-policy table require write-check policies, which node RLS does not yet support and QoD: writes to a column-policy table are not supported in native CLS. The gateway also refuses a write, or a batch, that reads a table a column policy covers, even through its unprotected columns. A user with an insert grant and no applicable policy on the table still writes it.
  • Policies are base-table policies. A policy naming a view (or a table macro) refuses reads of that view; move it to the base table. A wildcard policy applies to base tables, not to the columns a view projects.
  • A policy on a generated column refuses reads of its table: QoD: native CLS does not support policies on generated columns; protect their source columns instead.
  • A mask that fails on a row yields NULL for that row, and a row predicate that fails on a row hides it. Neither answers with an error.
  • Also refused to a policy holder: EXPLAIN and EXPLAIN ANALYZE over a table a row policy covers (QoD: EXPLAIN of a row-policy table exposes protected estimates) and DuckLake change feeds of a covered table.
  • A policy that cannot be applied refuses the statement, never runs it unprotected: QoD: row policy could not be bound to its table (for example a predicate naming a column the table no longer has), QoD: column mask cannot be applied safely with its original column type, QoD: conflicting column masks.
  • A node that cannot fetch a session's policies from its replica refuses the statement with QoD: policy snapshot unavailable; retry. Run it again.

Table grants, the metadata filter, the time-travel and historical-name checks and the refusals of statement-text functions to policy holders are unchanged. See Access control model.

Masks keep their column's type​

The node binds a mask against its column and refuses every read of that column, with QoD: column mask cannot be applied safely with its original column type, unless the mask's result has exactly the column's type. A bare NULL is cast to the column's type and always fits. A new mask may only use the allowed forms (see Access control model), whose results are text or DOUBLE, apart from hash, which returns UBIGINT (so hash(email) does not fit a VARCHAR column), so:

  • On a VARCHAR column, every text mask fits: '***', left(email, 2) || '***', md5(CAST(email AS VARCHAR)).
  • On a DOUBLE column, DOUBLE arithmetic fits: round(TRY_CAST(salary AS DOUBLE) / 1000) * 1000.
  • On a column of any other type (INTEGER, BIGINT, DECIMAL, DATE, TIMESTAMP, ...), use NULL, a constant of the column's type, or a deny.

To list the masks to review, on the control-plane database:

SELECT r.tenant_id, r.name AS role, p.id, p.catalog_name, p.schema_name, p.table_name,
p.column_name, p.transform_sql
FROM qodstate_role_column_policy p
JOIN qodstate_role r ON r.id = p.role_id
WHERE p.action = 'mask'
ORDER BY r.tenant_id, p.table_name, p.column_name;

Then check each one's column type with DESCRIBE as a superuser.

Boot reports​

At each boot the manager prints one WARN: line on stderr for each of these, naming the tenant, the role, the policy id and the table, never the policy's text:

  • A row policy whose predicate names a column its table no longer has, or that cannot be applied at all. Every statement reading the table under that role is refused. Policies with a wildcard schema or table are not checked.
  • A stored mask that a create would now refuse (outside the allowed forms, or read by the parser only in part). Such a mask applies as a deny: every read of its column is refused until it is rewritten. Rewrite it with the allowed forms: md5(CAST(email AS VARCHAR)) rather than md5(email), numbers over TRY_CAST(<column> AS DOUBLE), subscripts with constant indexes.

A mask stored before 0.15.0 that holds // was stored as the part before it, which can be the bare column; no check can tell it from a mask written so, so check the stored text of each mask once.

Update or delete each policy named.

DuckDB 2.0.1​

The engine, the nodes and the JDBC driver move to DuckDB 2.0.1. Catalogs stay at DuckLake 1.1 and nothing migrates. The Quack protocol stays 3, so DuckDB 2.0.0 and 2.0.1 clients both reach the native front door.

  • The 2.0.1 quack client refuses READ_ONLY and every ATTACH option but token, secret, disable_ssl, ssl_fingerprint, client_id and heartbeat_timeout, so ATTACH 'quack:host:9494' AS qod (TYPE quack, READ_ONLY, ...) fails on the client. Drop READ_ONLY and give the user read-only grants instead. See ATTACH options.
  • The functions and settings 2.0.1's extensions add (the aws extension's S3, S3 Tables and CloudFormation table functions, iceberg_partitions, iceberg_schemas, iceberg_expire_snapshots, parquet_page_index, duckdb_live_query_metrics and others) are superuser-only on nodes.
  • The iceberg extension needs avro loaded first. Nodes install avro before an Iceberg source's setup SQL, so Iceberg sources are unaffected, but an initSql that loads iceberg on a node without avro installed fails.

Federated sources of an unknown type​

A federated source whose sourceType names no built-in type is a plugin source, provided by a manager module (see Source types from manager modules); it is read-only unless created otherwise. Without the module that provides it, such a source is refused at write time and skipped when a node's setup is rendered, its siblings still attaching. A manifest with a misspelled sourceType is refused with unknown sourceType '<value>' (expected one of: ...), or its module is not loaded. A NULL or blank stored value still reads as sql.

What changes for clients​

  • MCP discovery for plain members. list_databases, list_tables, describe_table, table_history and list_snapshots answer a tenant member who is not an admin, with what their grants let them read. See Discovery for a plain member.
  • Branch change sets carry rowConflictsStatus (current, stale, not_computed) and countsAre: change_events. See Reading the change set.
  • Clients that send each statement as <alias>.query('<sql>'), such as Columnar's quack ADBC driver, work on the native front door. See DuckDB.

New in 0.15.0​

  • Connector extension points for manager modules: federated source types of their own, linked extensions in qod-node and policy obligations on their scans. Create a source of such a type with qod federation create --type <wire> --plugin-config <json>. See Connector extension points.
  • The Compare tab of a catalog table picks Schema or Data with two mutually exclusive checkboxes.