nextcloud / nextcloud/text

oc_text_steps seems to not be cleanupped

Open
#9,080 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

Describe the bug
In the database, oc_text_steps grows to ~3GB because it seems the cleanup does not run.
3GB is more than half my entire database size, so I expect it to become a bigger problem in the future.

I'd like to ask for hints to debug this.

Screenshots

It looks like the cleanup job runs and does "something". is there a way to get the logs of the job?

$ php occ background-job:list
| 87173              | OCA\Text\Cron\Cleanup              | 2026-08-19T15:15:02+00:00 | null   |
$ php occ background-job:execute 87173
[ ... ]
Last checked:         2026-08-19T15:20:02+00:00
Reserved at:          -
Last executed:        2026-08-19T15:15:02+00:00
Last duration:        23
Next execution:       2026-08-19T15:20:02+00:00

Job executed!

[...]

Last checked:         2026-08-19T15:20:02+00:00
Reserved at:          -
Last executed:        2026-08-19T15:22:57+00:00
Last duration:        21
Next execution:       2026-08-19T15:27:57+00:00

oc_text_steps does not seem to be cleanupped, even though the session_id/timestamps seem really old

select session_id,timestamp,length(data) from oc_text_steps where document_id=3212894;

+------------+------------+--------------+
| session_id | timestamp  | length(data) |
+------------+------------+--------------+
|     506062 | 1779201143 |           44 |
|     506064 | 1779201173 |           44 |
|     506064 | 1779201175 |        42730 |
|     506066 | 1779201223 |           57 |
|     506066 | 1779201225 |          117 |
[...]
|     527119 | 1787129951 |        12326 |
|     527119 | 1787129951 |        12327 |
+------------+------------+--------------+
49924 rows in set (2.088 sec)

+------------+------------+--------------+

the oc_text_sessions seem to be in order, though

select id,document_id,last_contact from oc_text_sessions limit 5;
+--------+-------------+--------------+
| id     | document_id | last_contact |
+--------+-------------+--------------+
| 514716 |      102771 |   1782251403 |
| 523501 |      102771 |   1785526060 |
| 524925 |      102771 |   1786194409 |
[...]
| 527117 |     3339234 |   1787145085 |
| 527174 |     3340247 |   1787152127 |
| 527168 |     3340247 |   1787152187 |
+--------+-------------+--------------+
2478 rows in set (0.006 sec)

The table is very big in general, the oc_text_steps.ibd is 2.7GB in size

select count(*) from oc_text_steps;
+----------+
| count(*) |
+----------+
|   585499 |
+----------+

SELECT table_name, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`  FROM information_schema.TABLES WHERE table_schema = 'nextcloud' AND table_name = 'oc_text_steps';
+---------------+------------+
| Table         | Size in MB |
+---------------+------------+
| oc_text_steps |    1242.22 |
+---------------+------------+

Server details:

  • Nextcloud version: 33.0.5
  • PHP Version: 8.4.22 (docker nextcloud:fpm)
  • Database: MariaDB 11.8.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OCA\Text\Cron\Cleanup job shown by php occ background-job:list, then run it with php occ background-job:execute and inspect its output. Compare stale rows in oc_text_steps with oc_text_sessions and the recorded timestamps. Done means the cleanup behavior is understood and obsolete step rows no longer accumulate.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.