Documentation
¶
Overview ¶
Package warehouse_cache maintains a process-wide cache of warehouses known to reject the legacy Thrift protocol.
A Reyden / Real-Time SQL warehouse rejects a Thrift OpenSession — the SQL Gateway proxy stamps SQLSTATE KP001 on the rejection. When the driver auto-recovers by re-opening on the kernel backend, it records the warehouse here so later connections to the same warehouse skip the doomed Thrift attempt and open on the kernel directly.
Keyed by (host, warehouse_id) — the host is part of the key so the same warehouse id observed on two different workspaces never collides. Entries expire after TTLSeconds so a warehouse later reconfigured to accept Thrift is eventually retried.
Index ¶
Constants ¶
const ( // TTLSeconds controls how long a cached Reyden warehouse entry remains valid. // Matches the ADBC driver's 6-hour horizon. TTLSeconds = 6 * 60 * 60 )
Variables ¶
This section is empty.
Functions ¶
func ExtractWarehouseID ¶
ExtractWarehouseID returns the warehouse/endpoint id embedded in httpPath, or empty string.
func IsKnownReyden ¶
IsKnownReyden returns whether warehouseID on host is known to reject Thrift.
func MarkReyden ¶
func MarkReyden(host, warehouseID string)
MarkReyden records that warehouseID on host rejects the Thrift protocol.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a thread-safe cache of warehouses known to reject Thrift.
func (*Cache) IsKnownReyden ¶
IsKnownReyden returns whether warehouseID on host is known (unexpired) to reject Thrift.
func (*Cache) MarkReyden ¶
MarkReyden records that warehouseID on host rejects the Thrift protocol. Performs opportunistic sweep of expired entries.