mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-25 18:43:32 +01:00
feat(fuse,core,cli): trace where each sync pass spends its time
Each pass over a mirror folder now records how long its stages take (lock wait, baseline, local walk, remote walk, plan, apply, cleanup). It also records the count and the total and max time of each kind of Drive call and applied op, how many items each stage handled, and the slowest folder listing on Drive. The trace is logged as "sync: pass trace" when a pass ends, is cut short or runs longer than 30 s. The running pass and the last pass over each folder go out in SyncEngineState::traces, which `pdfs diagnostics` prints. The new sim test found that a file uploaded by a pass gets a baseline row without a revision id: Drive does not list the node at once, and the upload returns only its uid. Since B294, the next pass reads such a file in full once and records the id.
This commit is contained in:
1 parent
ae24b7179b
commit
2d5ec1bd08
12 files changed
+796
-13
No files matched your search
@@ -441,6 +441,12 @@ Not changed: a pass still walks both trees before it applies anything, so a fold
|
||||
be walked in one run still never syncs. Applying changes per subtree as the walk goes is the
|
||||
fix for that, and is not done. The two-minute poll still walks every folder in turn.
|
||||
|
||||
Later: every pass keeps a trace of where its time went (`crates/pdfs-fuse/src/sync/trace.rs`),
|
||||
in the journal as `sync: pass trace` and in `pdfs diagnostics`. The sim test
|
||||
`a_mirror_pass_reports_where_its_time_went` showed that a file uploaded by a pass also gets a
|
||||
baseline row without a revision id, because Drive does not list it at once and the upload
|
||||
returns only its uid. The next pass reads it in full once and records the id.
|
||||
|
||||
**Verified:** `revision_ids_fill_only_rows_without_one`, `baseline_rows_are_counted_per_folder`,
|
||||
`folders_left_syncing_are_reset_to_error`, `only_an_unchanged_row_without_an_id_takes_the_revision`
|
||||
and `the_smallest_folders_run_first_in_a_burst` on 2026-11-25. Not yet checked on the reporter's
|
||||
|
||||
@@ -11,6 +11,14 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **`pdfs diagnostics` and the journal say where a sync pass spends its time.** Each pass over a
|
||||
synced folder records how long it took to walk this computer's copy, list Proton Drive, plan
|
||||
and apply. It also records how many calls to Proton Drive it made of each kind, how long they
|
||||
took, and which folder on Drive was slowest to list. The trace shows the running pass and the
|
||||
last pass over each folder, in the journal as `sync: pass trace` (B294).
|
||||
|
||||
## [3.10.0] — 2026-11-22
|
||||
|
||||
Schema: **47**. The trash table gets an index on the original folder, and its stored rows are
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ commands are for scripts and for cases where the mount is not available.
|
||||
| Command | Description |
|
||||
|---|---|
|
||||
| `pdfs diagnose` | Check the installation and print a report. Works without the service. When the service does not answer, also asks Proton which of your keys open. Exits non-zero if a check fails. |
|
||||
| `pdfs diagnostics` | What a running service is doing now: worker threads, queues, requests in flight, memory. For a service that has stopped answering. |
|
||||
| `pdfs diagnostics` | What a running service is doing now: worker threads, queues, requests in flight, memory, and where each synced folder's last pass spent its time. For a service that has stopped answering, or a synced folder that never finishes. |
|
||||
| `pdfs cache inspect [--deep]` | Database size, reclaimable space, row counts, cache use against the limit. `--deep` also runs SQLite's integrity check (slow). |
|
||||
| `pdfs cache vacuum` | Compact the database. Needs free space for a second copy of it while it runs. |
|
||||
| `pdfs cache clear` | Delete cached file content. Files kept available offline stay. |
|
||||
|
||||
@@ -263,6 +263,38 @@ pdfs sync reset 1
|
||||
This downloads what Proton Drive has and uploads what only this computer has. Nothing is deleted.
|
||||
If you deleted the files on purpose, delete them on Proton Drive too, or stop syncing the folder.
|
||||
|
||||
### A synced folder takes hours, or never finishes
|
||||
|
||||
Every pass over a synced folder leaves a trace of where its time went. `pdfs diagnostics` shows
|
||||
the running pass and the last pass over each folder (one line each, wrapped here):
|
||||
|
||||
```
|
||||
sync engine: pass on folder 2 for 2h14m, last progress 0s ago
|
||||
folder 2 pass (running, 2h14m): baseline 3.1s, local walk 41m05s, remote walk 1h32m;
|
||||
list children 1200x/4m10s (max 3.0s), read nodes 1200x/12m40s (max 4.2s),
|
||||
read nodes full 1100x/1h15m (max 9.8s); local entries 493000, remote folders 1200,
|
||||
nodes 310000, nodes full 290000, revisions recorded 290000; slowest listing "Fotos/2019" 9.8s
|
||||
```
|
||||
|
||||
The journal has the same line as `sync: pass trace` when a pass ends, is cut short or takes longer
|
||||
than 30 seconds:
|
||||
|
||||
```bash
|
||||
journalctl --user -u proton-drive.service | grep 'sync: pass trace'
|
||||
```
|
||||
|
||||
What the parts mean:
|
||||
|
||||
- **Stages:** `local walk` reads this computer's copy, `remote walk` lists Proton Drive, `plan`
|
||||
decides what to do with each path, `apply` uploads, downloads and creates folders, and `cleanup`
|
||||
removes deleted folders. `lock wait` is time spent waiting for a mode switch or a move to finish.
|
||||
- **`read nodes full`** unlocks one key per file, to read a size that changed or was never
|
||||
recorded. A high count here on a folder that has not changed is the slow case from B294. Each
|
||||
pass records what it read, so the count falls on the next pass even if this one is cut short.
|
||||
- **`slowest listing`** names the folder on Proton Drive that took longest to list.
|
||||
|
||||
Please include these lines when you report a slow folder.
|
||||
|
||||
### Files named `(sync-conflict …)` appeared
|
||||
|
||||
The file changed in two places at once. Nothing was lost. See
|
||||
|
||||
Reference in new issue
Block a user