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

  1. Textual Notification:
    Add the capability to send text-based notifications via pgproto.
  2. 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 pgwire protocol, 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 Parse command (first step in extended query protocol). Also known as shard-awareness.

Further reading:

ADRs:

MRs:

Edited by Dmitry Ivanov