mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-13 16:32:56 +00:00
Before this PR, during shutdown, we'd find naked logs like this one for every active page service connection: ``` 2023-07-05T14:13:50.791992Z INFO shutdown request received in run_message_loop ``` This PR 1. adds a peer_addr span field to distinguish the connections in logs 2. sets the tenant_id / timeline_id fields earlier It would be nice to have `tenant_id` and `timeline_id` directly on the `page_service_conn_main` span (empty, initially), then set them at the top of `process_query`. The problem is that the debug asserts for `tenant_id` and `timeline_id` presence in the tracing span doesn't support detecting empty values [1]. So, I'm a bit hesitant about over-using `Span::record`. [1] https://github.com/neondatabase/neon/issues/4676