Send cluster topology metadata & updates to pgproto clients
Proposed Solution
Since the target protocol for Picodata Golang client is pgwire, it is suggested to implement the functionality for sending textual notifications in the pgproto module. This functionality should replicate the behavior of the RAISE NOTICE mechanism from PostgreSQL.
Implementation Details
-
Textual Notification:
Add the capability to send text-based notifications viapgproto. -
Event Format:
Represent topology change events as predefined text messages in JSON format, which is widely used and has parsing capabilities available in Go's standard library.
Benefits
- Aligns with the
pgwireprotocol, maintaining protocol consistency. - Provides a standardized, developer-friendly and event-driven solution to handle topology changes.
- Similarly to CQL (see scylla-rust-driver), allows us to prepend primary key metadata when we reply to client's
Parsecommand (first step in extended query protocol). Also known as shard-awareness.
Further reading:
- https://rust-driver.docs.scylladb.com/stable/statements/statements.html
- https://rust-driver.docs.scylladb.com/stable/statements/prepared.html
ADRs:
MRs:
Edited by Dmitry Ivanov