Is there a way to close a session (CLOSE_SESSION) that is not running a query without a race conditi

Hello and thanks for Vertica help,

As part of a graceful shutdown script for a node the SESSIONS table is examined for sessions that do not have running statements, CLOSE_SESSION is used to close the session (MaxClientSessions has previously been set to 0).  When attempting to combine the CLOSE_SESSION function with SELECTs against the SESSIONS table (to try and avoid/reduce the possibility that a statement has started on the session before it is closed) ,  this error "CLOSE_SESSION is a meta-function and cannot be used with non-Select clauses" is seen. UPDATE: I had incorrectly assumed that MaxClientSessions could be set per node, if new session logins can not be disabled for a node then it makes a graceful shutdown script less viable. Using iptables with conntrack or a filter on TCP SYN to reject new incoming login connections is probably too much of a hack.
Grateful for any suggestions.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file