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

fix: Delete inactive sessions in one query #4339

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Jun 21, 2023

Fixes #4218

Delete inactive sessions without steps in one query as the oracle limit is only about 1000 expressions. Using one query also has the benefit to avoid deadlock scenarios as the query would lock the rows directly.

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

@cypress
Copy link

cypress bot commented Jun 21, 2023

Passing run #10776 ↗︎

0 146 1 0 Flakiness 0

Details:

fix: Delete inactive sessions in one query
Project: Text Commit: 85ef18d3fa
Status: Passed Duration: 03:49 💡
Started: Jun 29, 2023 6:52 AM Ended: Jun 29, 2023 6:56 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@juliushaertl
Copy link
Member Author

Sqlite somehow fails, but only on CI 🙈

  1. OCA\Text\Db\SessionMapperTest::testDeleteInactiveWithoutSteps1010
    Failed asserting that actual size 1009 matches expected size 0.

/home/runner/actions-runner/_work/text/text/apps/text/tests/unit/Db/SessionMapperTest.php:97

@juliushaertl juliushaertl force-pushed the bugfix/3989/delete-inactive branch 3 times, most recently from e81d694 to 163b07a Compare June 21, 2023 19:43
@juliushaertl
Copy link
Member Author

Let me split this to have only the query change as a backportable fix, as mentioned above the index could be considered a separate enhancement

@juliushaertl juliushaertl requested a review from blizzz June 29, 2023 06:48
@juliushaertl juliushaertl added bug Something isn't working 3. to review labels Jun 29, 2023
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl
Copy link
Member Author

@blizzz @mejo- 🏓 for a review, would be nice to get this in for the next maintenance release to reduce log spam on our instance ;)

@blizzz blizzz merged commit 2dfe30a into main Jul 10, 2023
35 checks passed
@delete-merged-branch delete-merged-branch bot deleted the bugfix/3989/delete-inactive branch July 10, 2023 10:37
@blizzz
Copy link
Member

blizzz commented Jul 10, 2023

@blizzz @mejo- ping_pong for a review, would be nice to get this in for the next maintenance release to reduce log spam on our instance ;)

please trigger the necessary backports

@juliushaertl
Copy link
Member Author

/backport to stable27

@juliushaertl
Copy link
Member Author

/backport to stable26

@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@juliushaertl juliushaertl added this to the Nextcloud 28 milestone Jul 10, 2023
juliushaertl added a commit that referenced this pull request Jul 19, 2023
reverts #4339 and #4539 except for the added tests and moves to plain
PHP chunking to avoid issues with MySQL 8

Signed-off-by: Julius Härtl <jus@bitgrid.net>
juliushaertl added a commit that referenced this pull request Jul 19, 2023
reverts #4339 and #4539 except for the added tests and moves to plain
PHP chunking to avoid issues with MySQL 8

Signed-off-by: Julius Härtl <jus@bitgrid.net>
juliushaertl added a commit that referenced this pull request Jul 19, 2023
reverts #4339 and #4539 except for the added tests and moves to plain
PHP chunking to avoid issues with MySQL 8

Signed-off-by: Julius Härtl <jus@bitgrid.net>
backportbot-nextcloud bot pushed a commit that referenced this pull request Jul 19, 2023
reverts #4339 and #4539 except for the added tests and moves to plain
PHP chunking to avoid issues with MySQL 8

Signed-off-by: Julius Härtl <jus@bitgrid.net>
backportbot-nextcloud bot pushed a commit that referenced this pull request Jul 19, 2023
reverts #4339 and #4539 except for the added tests and moves to plain
PHP chunking to avoid issues with MySQL 8

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
2 participants