Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway Timeout error when moving a document in a large team site #1271

Open
1 of 2 tasks
vviers opened this issue Oct 16, 2024 · 1 comment
Open
1 of 2 tasks

Gateway Timeout error when moving a document in a large team site #1271

vviers opened this issue Oct 16, 2024 · 1 comment
Labels
bug Something isn't working gouv.fr

Comments

@vviers
Copy link
Collaborator

vviers commented Oct 16, 2024

Describe the current behavior

The issue is very similar to #1005 and #824

When trying to move a document from one workspace to another, the SQL query can timeout if the parent org of the workspaces has a large number of members.

The suboptimal SQL query is here :

const docQuery = this._doc(scope, {
manager,
markPermissions: Permissions.OWNER
})
.leftJoinAndSelect('docs.aclRules', 'acl_rules')
.leftJoinAndSelect('acl_rules.group', 'doc_groups')
.leftJoinAndSelect('doc_groups.memberUsers', 'doc_users')
.leftJoinAndSelect('workspaces.aclRules', 'workspace_acl_rules')
.leftJoinAndSelect('workspace_acl_rules.group', 'workspace_groups')
.leftJoinAndSelect('workspace_groups.memberUsers', 'workspace_users')
.leftJoinAndSelect('orgs.aclRules', 'org_acl_rules')
.leftJoinAndSelect('org_acl_rules.group', 'org_groups')
.leftJoinAndSelect('org_groups.memberUsers', 'org_users');

Steps to reproduce

  1. Have a large team site with lots of users (several hundreds)
  2. Try to move a document from one workspace to another

Describe the expected behavior

No response

Where have you encountered this bug?

Instance information (when self-hosting only)

  • Grist instance:
    • Version: 1.2.0
    • Installation mode: kubernetes.
    • Architecture: multi-workers
@vviers vviers assigned vviers and unassigned vviers Oct 16, 2024
@vviers vviers added bug Something isn't working gouv.fr labels Oct 16, 2024
@fflorent
Copy link
Collaborator

The suboptimal SQL query is here :

I am more prudent about this assertion. I agree that this query (but also this one) are currently our best guesses.

This still should be reproduced in an appropriate environment and measured properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gouv.fr
Projects
Status: No status
Development

No branches or pull requests

2 participants