Commit Graph

143 Commits

Author SHA1 Message Date
Andrey Antukh 88fb5e7ab5 ♻️ Update integrant to latest version
This upgrade also includes complete elimination of use spec
from the backend codebase, completing the long running migration
to fully use malli for validation and decoding.
2024-11-13 19:09:19 +01:00
Andrey Antukh 32126d1874 ♻️ Refactor file changes gc tasks
Make it more friendly with the current snapshoting mechanism
2024-10-30 13:39:38 +01:00
Andrey Antukh a8814dcaba 🐛 Add missing fields on file-gc libraries fetching sql 2024-09-12 21:07:19 +02:00
Andrey Antukh 50df2279a7 🐛 Make the media cleaning on file-gc task aware of snapshots
It now takes in account the snapshots, and prevents
deletion of media files used in snapshots.
2024-09-03 14:50:17 +02:00
Andrey Antukh ceaafdbb1c Add offload mechanism for file snapshots 2024-08-26 13:52:42 +02:00
Andrey Antukh 8dea5d5158 ♻️ Make file-xlog-gc task more scalable 2024-08-26 11:15:59 +02:00
Andrey Antukh 77c45ed109 Add better error reporting on offload-file-data task 2024-08-12 11:55:19 +02:00
Andrey Antukh ab461ba560 🐛 Launch offload only if file-gc has processed the file 2024-08-12 11:55:19 +02:00
Andrey Antukh ba167f256b Add performance enhancements on telemetry related queries 2024-08-09 14:28:18 +02:00
Andrey Antukh 0e92bcc0de 🎉 Add file-data offload mechanism 2024-08-09 14:28:18 +02:00
Andrey Antukh 253b9e5bd8 Split file-gc task in two separated tasks
Add a new file-gc-scheduler task for analizing all files for
elegibility and leave file-gc task with the responsability to
performn the GC operation.
2024-08-09 14:13:33 +02:00
Andrey Antukh 5cf54c6384 Improve file snapshoting mechanism 2024-07-29 10:19:34 +02:00
Andrey Antukh 9174bb140b ♻️ Refactor configuration validation
Replace spec with schema
2024-07-10 15:16:28 +02:00
Andrey Antukh f9af7f0f09 🐛 Make profile deletion follow the delete-object flow
This removes the need of the specific task for cleaning
orphan teams.
2024-06-27 14:00:52 +02:00
Andrey Antukh 67489c0bb9 🐛 Fix profile deletion issue with 1 participant 2024-06-27 13:56:39 +02:00
Andrey Antukh ec4260830c ♻️ Add API consistency fixes for task calling
Also adds a helper for calling tasks synchronously
2024-06-25 13:24:17 +02:00
Andrey Antukh aa1cf3e03a Add some redundancy to delete_object task 2024-06-25 13:06:44 +02:00
Andrey Antukh 574c8d1789 Move library-absorb operation to async task
And make it not mandatory in case of failure
2024-05-27 11:19:15 +02:00
Andrey Antukh 39119ac040 Reuse team deletion logic on orphan teams gc task 2024-05-27 11:17:00 +02:00
Andrey Antukh 761bbb7334 Add srepl helpers for delete/restore teams, projects, and files 2024-05-27 11:17:00 +02:00
Andrey Antukh f3346786ea 🔥 Remove unused object-update task 2024-05-23 16:36:43 +02:00
Andrey Antukh 584a0fdba1 Reduce locking on objects-gc task
The main issue was the long running gc operation that
affects storage objects with deduplication. The long running
transacion ends locking some storage object rows which collaterally
made operations like import-binfile become blocked indefinitelly
because of the same rows (because of deduplication).

The solution used in this commit is split operations on small
chunks so we no longer use long running transactions that holds
too many locks. With this approach we will make a window to work
concurrently all operarate the distinct operations that requires
locks on the same rows.
2024-05-23 16:35:54 +02:00
Andrey Antukh e27c0b2086 Add a task for asynchronous object update operation 2024-04-16 16:42:44 +02:00
Andrey Antukh 9c25723ee3 📎 Add note about fragments on object-gc ns 2024-04-10 15:31:49 +02:00
Andrey Antukh 6b552fd8a9 🐛 Don't run file-gc on deleted files 2024-04-10 15:31:49 +02:00
Andrey Antukh eaf546ba5e Add improvements to telemetry task 2024-03-25 15:07:55 +01:00
Andrey Antukh a6562619a3 🐛 Fix incorrect fragment cleaning on file-gc task 2024-03-22 12:59:36 +01:00
Andrey Antukh 91118bec70 Improve internal naming of setup/props
This reverts commit a6f70c77cb.
2024-03-14 10:48:23 +01:00
alonso.torres a6f70c77cb Revert " Improve internal naming of setup/props"
This reverts commit f525c6df5e.
2024-03-13 16:21:12 +01:00
Andrey Antukh eabec6be20 🔥 Remove not needed events 2024-03-13 11:40:16 +01:00
Andrey Antukh f525c6df5e Improve internal naming of setup/props 2024-03-13 11:39:53 +01:00
Andrey Antukh b718a282e0 ♻️ Add minor refactor to file migrations
Relevant changes:

- Add the ability to create migration in both directions, defaulting
  to identity if not provided
- Move the version attribute to file table column for to make it more
  accessible (previously it was on data blob)
- Reduce db update operations on file-update rpc method
2024-02-19 09:20:47 +01:00
Andrey Antukh afd68fa09d 🐛 Properly handle fdata features on file-gc task
It also adds a schema validation process after cleaning. If file
does not validates it will be skiped.
2024-02-13 19:36:10 +01:00
Andrey Antukh 4cd9237f47 🐛 Fix unexpected exception on task-gc
Because table was renamed but the sql on the task function
still uses the old name.
2024-02-12 14:55:42 +01:00
Andrey Antukh 7f60946204 ♻️ Refactor exportation and duplicate mechanism
Previously the file processing was implemented 3 times using similar
approaches bug each own with its own bugs. This PR unifies the
loging to a single implementation used by the 3 operations.
2024-01-30 16:27:16 +01:00
Andrey Antukh 746d898245 Improve the db api efficiency
Mainly setup proper defaults and reduce unnecesary allocations
on every db api call.
2024-01-04 12:41:16 +01:00
Andrey Antukh addb392ecc Add safety mechanism for direct object deletion
The main objective is prevent deletion of objects that can leave
unreachable orphan objects which we are unable to correctly track.

Additionally, this commit includes:

1. Properly implement safe cascade deletion of all participating
   tables on soft deletion in the objects-gc task;

2. Make the file thumbnail related tables also participate in the
   touch/refcount mechanism applyign to the same safety checks;

3. Add helper for db query lazy iteration using PostgreSQL support
   for server side cursors;

4. Fix efficiency issues on gc related task using server side
   cursors instead of custom chunked iteration for processing data.

   The problem resided when a large chunk of rows that has identical
   value on the deleted_at column and the chunk size is small (the
   default); when the custom chunked iteration only reads a first N
   items and skip the rest of the set to the next run.

   This has caused many objects to remain pending to be eliminated,
   taking up space for longer than expected. The server side cursor
   based iteration does not has this problem and iterates correctly
   over all objects.

5. Fix refcount issues on font variant deletion RPC methods
2024-01-03 10:56:57 +01:00
Andrey Antukh 417366d998 Reorganize fdata/pointer-map feature helpers
Mainly move all pointer-map related helpers from app.rpc.commands.files
to the the app.features.fdata namespace and normalizes codestile around
feature handling on all affected code.

This commit also comes with several features related bugifxes on the
components-v2 migration code:

- properly migrate legacy feature names on apply components-v2 migration
- start using new fdata feature related functions
- prevent generation of a ephimeral pointer on each graphic migration
  operation; on large files this caused a very noticiable overhead of
  creating a big number of completly unused pointer maps
- do persistence after validation and not before
2023-12-13 14:20:07 +01:00
Andrey Antukh 87615ce221 💄 Fix format issues on backend module 2023-11-29 12:55:58 +01:00
Andrey Antukh d82ebdc034 Add deduplication for file object thumbnails 2023-11-24 11:06:47 +01:00
Alejandro Alonso 1913395c47 🎉 Support for images as fills 2023-11-14 12:39:53 +01:00
Aitor 7951350762 🐛 Fix db table tagged thumbnails 2023-11-07 16:01:00 +01:00
Andrey Antukh 6f93b41920 🎉 Add features assignation for teams 2023-11-07 12:48:31 +01:00
alonso.torres dd8480cd87 Fix problem with garbage collection 2023-11-02 11:06:30 +01:00
Andrey Antukh 496afb0f25 Merge remote-tracking branch 'origin/staging' into develop 2023-08-24 12:02:40 +02:00
Andrey Antukh 661a916a5f 🐛 Fix reference counting of file-media objects in :fill-image attr 2023-08-21 19:11:55 +02:00
Andrey Antukh 1190cf837b Add an internal approach to prevent xlog gc to remove file changes 2023-08-03 16:40:42 +02:00
Andrey Antukh 405aa66357 🎉 Add new shape & rect data structures
Also optimizes some functions for faster shape and rect props
access (there is still a lot of work ahead optimizing the rest of
the functions)

Also normalizes shape creation and validation for ensuring
correct setup of all the mandatory properties.
2023-07-11 17:27:35 +02:00
Andrey Antukh d11b007795 Add thumbnail renderer
And integrate the dashboard thumbnails to use that service
2023-06-21 20:10:49 +02:00
Andrey Antukh 0078c0e601 🐛 Fix missing pointer persistence on file gc task 2023-05-26 08:04:01 +02:00