Skip to content

M2: Connect and introspect #3

Description

@tamnd

The third milestone of rupg, specified in spec/23-milestones.md section 23.5. M2 lets a real client connect, authenticate, read the catalog and see the schema. It delivers protocols 3.0 and 3.2, TLS, SCRAM-SHA-256, the virtual catalog, and the text and binary forms of the types. Gate G1 closes here.

Why

Connect before query. A client can test nothing until it connects. Many clients read the catalog before they send any user query, so the catalog comes with the connection. This is "follow the client" and "catalog before dialect" of the compatibility work of rudb.

G1 needs clients to read the catalog with SQL. So the SQL front, a first analyzer and a simple executor ship at M2, and M3 completes them (spec/24 §24.2, item C9). The parser is the full vendored grammar from the start, because the grammar is one file.

The work

Taken from spec/23 §23.5. The reference in brackets names the spec section that owns the detail. Change the list in the spec and copy it again. Do not edit it here.

  • rupg-wire and rupg-server: startup, NegotiateProtocolVersion, SSL negotiation, SCRAM, the simple and extended query flows, cancel, and ParameterStatus (spec/06 §6.5, spec/06 §6.6, spec/06 §6.7, spec/06 §6.9.1, spec/06 §6.12)
  • rupg-session with the 438 settings, SET, SHOW and RESET (spec/06 §6.13)
  • rupg-catalog and rupg-pgcatalog: the built-in objects with their OIDs, the 64 catalogs, the 86 system views and the 65 information_schema views, as virtual tables (spec/07 §7.12, spec/07 §7.13, spec/07 §7.14)
  • The types with text and binary forms equal to the oracle (spec/07 §7.9)
  • The parser from the full vendored grammar (spec/07 §7.2)
  • The analyzer, the plan and the executor for SELECT with joins, subqueries, CASE, casts to regclass and regtype, and the functions that the 48 recorded traces call on the catalog, for example format_type, pg_get_expr, pg_get_indexdef and pg_get_constraintdef (spec/23 §23.5, spec/07 §7.16, spec/07 §7.17)
  • DDL that creates tables, columns, constraints and index definitions (spec/23 §23.5, spec/07 §7.11)
  • The L1 traces of the 48 clients, with the share of identical messages published for each (spec/21 §21.15)
  • The L2 comparison of every catalog row for the gate schema (spec/05 §5.2)
  • The 9 libpq_pipeline tests (spec/21 §21.4.1)
  • The pg_dump round trip (spec/21 §21.4.1)
  • 24 CPU hours each on wire_frontend, wire_startup, type_input and type_recv with no open find (spec/21 §21.7)
  • The idle session test against the 64 KiB limit (spec/21 §21.13, spec/06 §6.4)
  • The connection rate with trust over a Unix socket and with SCRAM over TLS, against the oracle. The target is at least 10x the oracle (spec/06 §6.18)
  • Crates that first ship: rupg-wire, rupg-catalog, rupg-pgcatalog, rupg-sql, rupg-analyze, rupg-plan, rupg-func, rupg-exec, rupg-session and rupg-server (spec/23 §23.2)

Exit criterion

  1. G1 (spec/02 §2.10): 100 percent of 7 clients connect and show the schema. The seven are psql, pgAdmin 4, DBeaver, psycopg 3, node-postgres, pgx and asyncpg. "Show the schema" means that the client's own object browser or describe command lists the tables, columns, types, indexes and constraints of the gate schema, equal to the list that the same client shows against the oracle (spec/21 §21.4.2).
  2. The report publishes the share of identical L1 messages for each of the 48 clients, and the L2 comparison of every catalog row for the gate schema.
  3. An idle session costs at most 64 KiB (spec/06 §6.4).
  4. wire_frontend, wire_startup, type_input and type_recv each run 24 CPU hours with no open find.
  5. The close report answers each line of the checklist in spec/23 §23.18 that applies from M2.

Open questions

These questions in spec/24 close at M2.

Harness work

Depends on

#2.

Spec

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/catalogThe catalog, pg_catalog, information_schema and the statistics views.area/sessionSessions, settings, pooling and the server runtime.area/sqlThe grammar, the lexer, the analyzer and the rewriter.area/typesTypes, type I/O, casts and collations.area/wireThe protocol, TLS, authentication and COPY.gate/G1G1: 7 clients connect and show the schema (L1, L2).kind/milestoneA milestone from spec/23-milestones.md.priority/p0Stop other work. A wrong answer, a data loss, or a broken gate.status/gateHas a numeric exit criterion that decides if the milestone is done.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions