mirror of https://github.com/hashicorp/boundary
There is a new periodic job that will delete terminated sessions that are older than one hour. However, since until now terminated sessions were not deleted, the first time the job runs there could be a large number of sessions that need deleted. This could have a negative impact on a running cluster. To mitigate the operational risk, this adds a migration to perform an initial delete while the cluster is offline.pull/2160/head
parent
f9eab71a4a
commit
5b0abe2e27
@ -0,0 +1,12 @@
|
||||
begin;
|
||||
delete from session
|
||||
using session_state
|
||||
where
|
||||
session.public_id = session_state.session_id
|
||||
and
|
||||
session_state.state = 'terminated'
|
||||
and
|
||||
session_state.start_time < wt_sub_seconds_from_now(3600);
|
||||
|
||||
analyze;
|
||||
commit;
|
||||
Loading…
Reference in new issue