-
Notifications
You must be signed in to change notification settings - Fork 110
Fix: Add cleanup for orphaned text steps #7653
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
Conversation
Signed-off-by: Benjamin Frueh <[email protected]>
Signed-off-by: Benjamin Frueh <[email protected]>
Signed-off-by: Benjamin Frueh <[email protected]>
|
Thanks a lot for tackling this @benjaminfrueh ! The wording here is confusing and we've been wanting to fix this for a while - but never got to it. However every 30 seconds we autosave the document including the full yjs editing history ( I'm sorry this is such a mess to begin with. It evolved over time and we did not manage to clean it up. I'm happy to talk it through with you to figure out which steps we can remove and how to clean this up for the future. |
mejo-
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…a safety buffer Signed-off-by: Benjamin Frueh <[email protected]>
…a safety buffer Signed-off-by: Benjamin Frueh <[email protected]>
|
Hi @max-nextcloud and @mejo- , thank you for the feedback. I've pushed some changes.
If you have any more suggestions or proposed changes for the cleanup I would be happy to discuss them with you in detail. |
|
Points from discussion with @benjaminfrueh:
|
|
@mejo- You are right. I was confusing what the query does. I was thinking it only removes steps for documents where no sessions exist anymore at all. But it would remove those from a session that stopped existing even if further sessions exist. Right now the client would fetch the steps that it can get. It may not notice that steps are missing if there are no steps arriving that depend upon them. If there are steps missing that later steps depend upon the client will notice and attempt to recover the state by loading the saved Detecting the missing step server side does not seem possible right now as we are just using the auto-incrementing id to retrieve newer steps. We used to have a version count that was per document and increased in steps of one - but I thought it was a clever idea to remove that 😶🌫️ - which I've been regretting ever since 😉 . But now you cannot tell if some step is missing in between the version provided by the client and the latest step. |
Co-authored-by: max-nextcloud <[email protected]> Signed-off-by: Benjamin Früh <[email protected]>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
max-nextcloud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for tackling this!
@mejo- and me observed an out of sync state that was persisted to the documentState and could be recovered by replaying all the steps.
We need to make sure we can always load the editing session from the documentState and the steps that follow it.
Right now this does not seem to be the case. Let's discuss together what can be done about this and then get this merged once we are sure the client does not write incomplete documentState anymore. See also #7704 and #7692 for the bigger picture.
max-nextcloud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There have been no reconnect attempts in the last week and we also observed none. So seems fine to clean up the orphaned steps as planned.
|
@mejo- I think your change request has been addressed, right? |
|
@max-nextcloud agreed, let's get this merged. I guess it should also be backported, right @benjaminfrueh? |
|
/backport to stable32 |
📝 Summary
The
oc_text_stepstable was growing significantly. One reason for that were orphaned steps accumulating in the database. Steps without existing sessions were never cleaned up by the existing cleanup job.This addresses orphaned steps only. A separate PR will add garbage collection for very old text sessions to prevent long-term accumulation.
The steps are deleted in batches of 1000 and the execution is time-limited for 30 seconds.
Fixes: #3740
Fixes: #3915
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)