deleting auth_session is VERY long

Description

Given a stack with 300000 tokens and 300000 sessions
When I try to delete 100 sessions it takes 21 seconds
When I add an index on auth_token.session_uuid
When I try to delete 100 sessions it takes no time at all!

This problem makes the cleanup function in wazo-auth hang and fail to do the cleanup making the stack unusable for API users.

Zendesk Ticket IDs

None

Activity

Show:

Pascal Cadotte October 4, 2021 at 1:53 PM

When adding the index make sure you handle cases where the index already exists. Many index have been created to fix production.

Pascal Cadotte September 16, 2021 at 1:05 PM

If this happens

sudo -u postgres psql asterisk

create index auth_token_session_uuid_idx on auth_token (session_uuid);

restart wazo-auth

wait a couple seconds and you’re done

Done

Details

Priority

Assignee

Reporter

Approvers

François Blackburn

Fix versions

Sprint

Zendesk Support

4

Created September 16, 2021 at 12:39 PM
Updated October 25, 2021 at 3:07 PM
Resolved October 19, 2021 at 9:11 PM

Flag notifications