store/freer: since the 17:15Z promote a freeing pass takes five to six minutes (3 to 8 s before) and free disk falls 30 GB a minute between passes #107

Open
opened 2026-11-18 17:29:49 +00:00 by xemmerling · 0 comments
Owner

Since the 17:15:44Z promote of 31934c00 the node's freer finishes a pass every five to six minutes. Before it, a pass came every 3 to 8 seconds. Between passes the node's free disk falls by about 30 GB a minute. No job has failed for disk yet; this is filed while it happens and will be updated.

Passes of the freer on ci-x86-1 (the worker's "freed the least worth of the cache" lines)

when gap before it entries freed bytes freed kept freeing pending
17:15:13Z to 17:15:56Z, twelve passes, old build 3 to 8 s about 310 a pass 9,688 312 to 371 GB 65 to 159 GB
17:20:41Z, new build 285 s 7,618 240 GB 2,340 0 0
17:26:41Z, new build 360 s 6,958 121 GB 3,030 213 GB 0

There were 287 passes from 16:55Z to 17:15:56Z, and two in the twelve minutes after. No commit between d748ed8d and 31934c00 touches src/store/freer.rs; its EVERY is 2 s on both.

Free disk (my watch on the node, df of /var/lib/t, with entries in /var/lib/t/deleting)

at free GB waiting to be deleted
17:19:04Z 949 11
17:21:20Z 941 61
17:23:35Z 866 0
17:25:04Z 807 0
17:26:34Z 744 0
17:27:19Z 718 90
17:28Z 710 0

Floor 440 GB, keep line 1,319 GB. The volume is 8,587 GB with 7,821 GB used; t_store_bytes says 7,793 GB.

What the node shows (read-only, 17:27Z)

  • The freer's thread was in state D in rename: xfs_rename, xfs_trans_reserve_quota_nblks, xfs_trans_dqresv. The deleter's thread slept in a futex with nothing queued.
  • The worker has 811 threads: 520 t-worker, 271 t-kept, 10 t-ahead.
  • Jobs wrote 118 to 134 GB every two minutes both before and after the promote (t_node_jobs_written_bytes_total). The node's store deleted 150 to 485 GB every two minutes before it and 18 to 136 GB after (t_node_store_deleted_bytes_total).
  • The freer's lines say blobs were taken in again after being freed: 344 blobs after 86 s on average at 17:20:43Z, and 1,565 after 169 s at 17:26:43Z.

Not read yet

  • Why a pass takes minutes on the new worker. Candidates I have not checked: the size of the first passes after a restart (7,000 entries against 310), the quota reservation the rename waits in, and the cold cache's new entries entering the freer's ranking with no uses.
  • Whether free disk settles above the floor once the old keys' entries are gone.

Related: issue 84's new section (a job's set-up waiting in the kernel while the node deletes), and the cold start from the v4 keys.

17:29Z, twelve seconds of samples on the node: what the freer and the deleter wait in. Free disk 673 GB.

sample freer thread deleter thread
1 D, fsync > xfs_log_force_seq > xlog_cil_force_seq > __flush_workqueue D, __flush_work
2 D, the same fsync D, xfs_qm_dqget_cache_lookup
3 D, rename > xfs_rename > xfs_trans_reserve_quota_nblks > xfs_trans_dqresv D, __flush_work
4 D, fsync, log force D, __flush_work
5 D, fsync, log force D, __flush_work
6 D, then a futex D, __flush_work
  • The freer was never on a CPU in six samples: it waits for the filesystem's log to be forced at each fsync, and for a quota reservation at each rename.
  • The worker's other threads in an uninterruptible wait at that moment: 108 t-worker in filename_create, 7 t-deleter in __flush_work, 5 t-worker in do_renameat2, 5 in __flush_work, 2 each in xlog_cil_commit, xfs_qm_vop_dqalloc and do_rmdir.
  • So a hundred threads creating files, the deleter and the freer all wait on the same filesystem at once. The freer's pass is slow because each of its steps queues behind them, not because it computes for long (its CPU time since the worker's start: 2.5 s user, 15.8 s system).
  • The 255 t-kept threads were all asleep.

17:32:02Z, the third pass on the new worker, 321 s after the second.

pass entries freed bytes freed kept after freeing available needs more free
17:20:41Z 7,618 240 GB 2,340 0 1,090 GB 229 GB
17:26:41Z 6,958 121 GB 3,030 213 GB 1,000 GB 106 GB
17:32:02Z 6,145 619 GB 3,708 66 GB 788 GB 465 GB
  • Three passes say 980 GB freed in sixteen minutes, yet free disk went from 949 GB (17:19Z) to 645 GB (17:31:51Z).
  • Each pass frees about twice as many entries as it keeps. The kept count grows by about 700 a pass, so most of what the cold start writes between two passes is freed at the next one. The 17:26:43Z line counts 1,565 blobs taken in again 169 s after being freed.
  • Free disk by my watch: 704 GB at 17:30:21Z, 674 GB at 17:31:06Z, 645 GB at 17:31:51Z. No job has ended for a full disk.

17:37:25Z, the fourth pass, 323 s after the third: it is converging, slowly.

pass entries freed bytes freed kept after freeing available
17:37:25Z 4,726 245 GB 4,770 432 GB 683 GB
  • Entries freed a pass fall (7,618, 6,958, 6,145, 4,726) and entries kept rise (2,340, 3,030, 3,708, 4,770).
  • The deleter is now the slower half. Entries in /var/lib/t/deleting after the third pass: 85, 221, 225, 247, 259, 323 from 17:32:38Z to 17:36:24Z, and 432 GB wait to be deleted after the fourth.
  • Free disk: 617, 600, 587, 584, 579, 561, 546 GB from 17:32:38Z to 17:37:11Z. The fall slowed from about 30 GB a minute to about 15.
  • The node's store by Prometheus (t_store_bytes): 7,704 GB at 17:18Z, 8,005 GB from 17:28Z, on a volume of 8,587 GB.
  • The compile cache warms all the same: unit hit rate by five minutes 23%, 52%, 51%, 71% to 17:35Z, against 88.6% before the promote.

17:44Z, on the new worker pod (the old one was deleted at 17:36:47Z, issue 108): free disk 452 GB, twelve above the floor.

  • The new worker started at 17:40:11Z. In its first four minutes and 12,235 log lines its freer has logged no pass.
  • Free disk: 534 GB at 17:38:41Z, 467 GB at 17:43:34Z, 452 GB at 17:44:25Z. Waiting in /var/lib/t/deleting: 231, 275, 289 entries. Job directories: 147.
  • The freer's thread: state D in fsync > xfs_log_force_seq > xlog_cil_force_seq > __flush_workqueue, as on the old worker.
  • The deleter has 17 threads. Fifteen were in state D in xfs_buf_lock under xfs_read_agi or xfs_read_agf, one slept, and four more showed in __flush_work. So the deleting threads queue on the locks of the filesystem's allocation groups: more threads do not delete faster.
  • Jobs view 17:43:44Z: disk offered 499 GB, booked 70 GB; 83 people's, 6 ci and 2 probe jobs running. No job has ended for a full disk in ten minutes.

Where this stands: the node writes faster than it deletes and is at its floor. What it frees is queued, and what is queued waits on the filesystem. I change nothing on the node.

17:45:50Z: under the floor. Free 434 GB against a floor of 440 GB. 345 entries wait in /var/lib/t/deleting, 102 job directories. The new worker has logged no freer pass in the five and a half minutes since its start.

17:48Z: the floor rule holds so far, and the new worker's first pass has a terabyte queued.

  • The new worker's first freer pass ended 17:47:00Z, six minutes and 49 seconds after its start: freed 7,037 entries, kept 2,959, freeing=1,010 GB, available 581 GB by its own count.
  • Free disk read on the node: 417 GB (17:46:28Z), 393 GB (17:47:11Z), 371 GB (17:47:53Z). Entries in /var/lib/t/deleting: 352, 359, 364.
  • The jobs view at 17:48:30Z: the node is healthy and offers 416 GB of disk; 57 ci asks and 28 people's asks wait with kind disk. Running: 64 people's, 4 ci, 1 probe.
  • Jobs ended since free disk went under the floor at 17:45:30Z: people 32 passed, 1 failed, 3 cancelled. None with a cause of t's own.
  • So the node is not failing jobs for disk. It is 70 GB under its floor with a terabyte chosen and not yet deleted, and the deleter's threads queue on the filesystem's allocation-group locks.

17:50Z: starts have stopped; the running jobs still write more than the node deletes. Per minute, from Prometheus:

minute jobs started GB jobs wrote GB the node deleted GB waiting to be deleted GB offered disk disk ceiling GB
17:43 3 72 57 1,010 556 141
17:45 4 50 22 1,010 479 141
17:47 4 62 113 1,010 434 141
17:48 0 57 40 519 414 0
17:49 0 64 66 519 399 0
17:50 0 56 42 519 368 0
  • Free disk read on the node: 417, 393, 371, 382, 349, 337 GB from 17:46:28Z to 17:49:53Z. About 360 entries stay in /var/lib/t/deleting.
  • The disk ceiling went to 0 at 17:48Z and no job has started since, so the rule that holds starts at the floor works.
  • The jobs that were already running write 50 to 64 GB a minute, and the node deletes 22 to 113 GB a minute. Free disk falls by the difference until those jobs end.
  • The node's store by t_store_bytes: 8,213 GB, then 8,367 GB from 17:48Z, on a volume of 8,587 GB.

17:56Z: it turned at 240 GB, after two jobs ended for a full disk.

at free GB entries waiting to be deleted job directories
17:51:20Z 314 358 66
17:52:03Z 295 792 59
17:53:29Z 265 804 47
17:54:12Z 240 799 42
17:55:33Z 311 262 39
  • Two jobs ended error | disk_full: j612-7866 (test/tilo-server, people's, 17:53:42Z) and j612-5170 (test-x86_64, people's, 17:54:54Z). They are the only ends with a cause of t's own since the new worker started.
  • The second pass on the new worker ended 17:51:28Z: freed 6,106 entries, 465 GB by its count, kept 4,156. The delete queue then stood near 800 entries for two and a half minutes.
  • What the deleter waited in at 17:55Z: eight of its threads in state D in unlinkat > evict > __flush_work, five in xfs_buf_lock. That is the same wait as the job-init of issue 84 in its overlay mount (evict > __flush_work): dropping an inode on this filesystem waits for a work item, for the deleter as for a job's set-up.
  • Then it moved: the node deleted 127 GB in the minute 17:54Z and 363 GB in 17:55Z, against 2 to 39 GB a minute from 17:48Z to 17:53Z. Running jobs had fallen to about 40 by then.
  • No job has started since 17:48Z. 123 asks wait with kind disk.

What I take from the whole hour, for whoever changes this: after a restart the freer picks thousands of entries in one pass, and each of its steps and each unlink of the deleter waits on the filesystem behind the jobs' own file creation. Under a cold start's writes the node deletes far slower than it chooses. The floor rule stops starts in time but not the running jobs' writes, and the volume came within 240 GB of full.

17:57Z: recovering, and the two checks were not run again.

  • Free disk: 311 GB (17:55:33Z), 430 GB (17:56:06Z), 421 GB (17:56:40Z). Entries waiting to be deleted: 262, 285, 218.
  • The two checks that ended error | disk_full have one job row each and no second job: test/tilo-server of run r2377fab35c (job ran 17:44:50Z to 17:53:42Z) and test-x86_64 of run r2df44d942f (17:40:15Z to 17:54:54Z). So their askers were told an error that was the node's.
  • No other job has ended for a cause of t's own since 17:55Z.
  • At 17:56:41Z the node offered 460 GB with 28 people's jobs running; 78 people's asks and 4 ci asks waited with kind disk, 68 ci asks for room.

17:58Z: back over the floor, and the freer passes in seconds again.

  • Free disk: 404 GB (17:57:13Z), 450 GB (17:57Z), 509 GB (17:58Z). Job directories 32, then 52 and 74: starts have resumed.
  • The freer's passes on the new worker:
pass ended gap before it entries freed bytes freed kept freeing
17:47:00Z 6 min 49 s from the start 7,037 20 GB 2,959 1,010 GB
17:51:28Z 268 s 6,106 465 GB 4,156 519 GB
17:55:58Z 270 s 1,779 14 GB 8,220 749 GB
17:56:46Z 48 s 2,128 599 GB 8,477 399 GB
17:57:35Z 49 s 1,596 6 GB 8,404 842 GB
17:58:06Z 31 s 1,774 417 GB 8,589 622 GB
17:58:22Z 16 s 1,610 6 GB 8,390 921 GB
  • So the pass time followed the load on the filesystem: minutes while a hundred or more jobs wrote, under a minute once about thirty ran. Nothing was changed on the node in between.
  • The pace of 3 to 8 s from before the promote is not back yet, and each pass still frees 1,600 to 2,100 entries.

18:02Z, correction: three jobs ended for a full disk, not two. Read again over the whole time since the new worker started, give-backs left out:

ended job run check class
17:53:42Z j612-7866 r2377fab35c test/tilo-server people
17:54:54Z j612-5170 r2df44d942f test-x86_64 people
17:57:49Z j612-4802 r2df44d942f test people

The third ended after the low point, while free disk was back at about 450 GB. No other cause of t's own is on record since 17:40Z. Free disk 507 GB at 18:01:05Z with 738 entries waiting to be deleted.

18:07Z, correction: the checks that ended for disk WERE run again. I read too early. My 17:57Z section says they were not; that was four minutes before their second jobs started. What the record holds now:

run check ended disk_full then
r2377fab35c test/tilo-server j612-7866, 17:53:42Z j612-8241 passed 18:05:16Z, two more jobs passed 18:05:22Z
r2df44d942f test-x86_64 j612-5170, 17:54:54Z j612-8246 passed 18:06:03Z
r2df44d942f test j612-4802, 17:57:49Z j612-8341 failed 18:02:12Z, the check's own outcome
r2df44d942f lint-head j612-5206, 18:04:42Z queued, waiting for disk, short by 11.4 GB
  • So there are four such ends, and no asker is left with an error from them. The cost is the work done twice: these jobs had run 9, 15, 17 and 24 minutes.
  • What disk_full is here, from the server's own lines: "the job ended at its own disk limit, which t booked: 57.9 GiB, holding 57.9 GiB; it runs again booked above both" (j612-4802) and the same for j612-5206 at 4.8 GiB. The job reached its own booking while the node, at its floor, had no room to grow it. The volume itself never filled.
  • The disk ceiling by minute (t_node_disk_ceiling_bytes): 0 from 17:48Z to 17:56Z, then 23, 12, 106, 13, 140, 107, 87, 87, 70 GB, and 0 again at 18:06Z.
  • Free disk is under the floor again: 449 GB (18:04:45Z), 407 GB (18:05:29Z), 414 GB (18:06:13Z). 85 ci asks and 19 people's asks wait for disk, 516 ci asks for room.

18:13Z: the ends at a disk limit go on with the node back over its floor. Six today, all since the promote.

ended job check booked held booked for the rerun
17:53:42Z j612-7866 test/tilo-server
17:54:54Z j612-5170 test-x86_64
17:57:49Z j612-4802 test 57.9 GiB 57.9 GiB 116.9 GiB
18:04:42Z j612-5206 lint-head 4.8 GiB 4.0 GiB 10.6 GiB
18:10:46Z j612-8386 test/tilo-server 31.5 GiB 30.8 GiB 64.0 GiB
18:11:53Z j612-8790 cargo check of four packages 16.0 GiB 16.1 GiB 33.1 GiB
  • job_history holds no disk_full end today before 17:00Z: three in the hour from 17:00Z, three so far in the hour from 18:00Z. A seventh job of the episode ended cache_unreachable on the same error inside the wrapper (issue 109).
  • The last two ended with free disk at 557 to 610 GB and the ceiling at 155 GB, so they are not the floor. The jobs hold what t booked for them, and the rerun is booked at a little over twice that.
  • My reading, not proven: the bookings were learned from jobs that were handed most of their crates, and under the cold cache with incremental off the same job writes about twice as much before a grow reaches it. The node grew 44 disk quotas from 17:57Z to 18:12Z, 18 of them in 18:11Z and 18:12Z.
  • Each such end costs the job's time so far: 9 to 24 minutes for the first four, 8 and 3 minutes for the last two.

18:29Z: the disk has recovered, and nothing was changed to make it.

  • Free disk: 602 GB (18:21:25Z), 792 GB (18:25:46Z), 953 GB (18:27:12Z), 1,009 GB (18:28:40Z). Entries waiting to be deleted: 453, 347, 46, 50.
  • No job has ended at its disk limit since 18:11:53Z. The episode's count stays at six disk_full and one cache_unreachable (issue 109), all run again; I checked the last two reruns in the job rows (one passed, one passed and then failed a later job on its own).
  • The whole excursion ran from 17:19Z (949 GB) through a low of 240 GB at 17:54:12Z back to 1,009 GB at 18:28:40Z: seventy minutes after a promote that started the cache cold, with the worker pod deleted in the middle of it.
  • What remains open here is the mechanism, not the state: passes of the freer that take minutes under load, a deleter whose threads queue on the filesystem, and disk bookings about half of what a cold build writes.

19:14Z: a second fall, and what the deleter is in the code

The fall. Free disk held near 900 to 1,200 GB from 18:28Z to 19:03Z and is falling again:

at free GB trees waiting in deleting/ job directories
19:03Z 901 204 137
19:06Z 864 522 186
19:08Z 795 628 259
19:10Z 755 826 96
19:12Z 649 1,062 85
19:13:37Z 572 954 69

By minute from Prometheus: the node deleted 2 to 104 GB a minute from 19:04Z to 19:08Z (190 to 741 before), jobs wrote 21 to 101 GB a minute, and what waits to be deleted rose from 357 GB (19:03Z) to 742 GB (19:12Z). The freer passes every few seconds again, freeing 95 to 738 entries a pass, keeping about 9,500.

The deleter, read in src/store/trees.rs on 31934c00.

  • One thread, Deleter::run (line 481), takes one tree at a time from its channel and calls remove_tree(&p, self.threads). The next tree waits until that one is gone.
  • remove_tree (line 300) shares that one tree's directories among up to 16 kept threads (deleter_threads, cores / 4 clamped to 16). The threads help only inside the tree in hand.
  • At 19:10:54Z, with 867 trees waiting, 11 of the 17 deleter threads slept on the tree's condition variable and 6 sat in __flush_work: the tree in hand had no directory left to hand out, and its unlinks waited on the filesystem.
  • The module's words size it for big trees: "one thread unlinks about 2.4k files a second, while a busy node's jobs leave trees of 100k–300k files every few seconds". Tonight the queue is counted in trees: the freer hands over hundreds of entries a pass, and every ended job a directory.
  • The deleter's idle I/O class (idle_io, line 69, mine from da6b2851) does nothing on this node: the store is /dev/md127, a RAID 0 of NVMe disks whose scheduler is none, which ignores classes. So that is not what slows it.

So the mismatch is in the shape of the work: the queue grows by trees, faster than one tree at a time can be removed whenever an unlink waits on the filesystem, and sixteen threads cannot help across trees.

What would hold "the node deletes at least as fast as it frees": the idle threads taking the next tree instead of sleeping, or a bound on what the freer hands over against what the deleter has finished. Both are the store's design, and a disk change needs a live-shape test before it ships. I commission nothing without your word; say which you would take.

19:15Z: the second fall turned at 559 GB, above the floor. Free disk 594 GB (19:13:11Z), 559 GB (19:13:56Z), 608 GB (19:14:12Z), 653 GB (19:14:44Z); trees waiting 1,074, 867, 675, 559. No job ended at its disk limit in it. One job could not be set up at 19:11:31Z, with about a thousand trees queued (j612-14802, test/tilo-server; issue 84).

20:02Z: a third fall, after the 19:47:42Z promote, and what the three have in common: each worker start is followed by the freer freeing most of what the node kept

The fall. Free disk 716 GB (19:50Z), 687 (19:55Z), 646 (19:57Z), 611 (19:58Z), 586, 550 GB (20:00:42Z), 498 GB (20:01:26Z). The delete queue this time is nearly empty while it falls: 53, 30, 0, 16 trees.

The freer around each of tonight's three worker starts (its own lines; "kept" is what it keeps after the pass):

worker start last passes before it first passes after it
17:15:59Z, promote every 3 to 8 s, about 310 entries a pass, kept 9,688 17:20:41Z freed 7,618, kept 2,340; 17:26:41Z freed 6,958; 17:32:02Z freed 6,145
17:40:11Z, pod replaced 17:47:00Z freed 7,037, kept 2,959; 17:51:28Z freed 6,106
19:48:13Z, promote 57 passes from 19:42Z to 19:47:54Z, 5 to 20 s apart, 108 to 182 entries a pass, kept about 9,850 19:51:09Z freed 5,419 (23 GB), kept 1,064; 19:53:11Z freed 8,636 (372 GB), kept 1,573; 20:01:06Z freed 7,372 (477 GB), kept 2,028
  • A running worker's freer keeps about 9,800 entries and frees 100 to 300 a pass. A freshly started worker's freer frees 5,000 to 8,600 entries a pass, minutes apart, and is down to 1,000 to 3,000 kept within a quarter of an hour.
  • The second start had no key change and the third moved no compile key, so this is not the old keys' entries being cleared out.
  • It also frees little for it: 5,419 entries for 23 GB at 19:51:09Z.

What follows from it each time: thousands of trees for a deleter that removes one at a time, free disk falling, job set-ups waiting beside the unlinks (issue 84), and the node's compile cache thrown away, which the hit rate shows (unit hits fell from 84% to 66% in the ten minutes after the pod replacement).

Not read: why a started worker's freer values its entries so differently. I am reading src/store/freer.rs for what it knows of an entry's uses and sharing after a start, and add it here.

20:04Z: under the floor a second time tonight, and one cause ruled out.

  • Free disk: 498 GB (20:01:26Z), 459 GB (20:02:37Z), 437 GB (20:03:11Z), 406 GB (20:03:46Z). The delete queue holds 0 to 17 trees: this fall is not a backlog. The node deleted 251 GB in the minute 20:02Z while jobs wrote 78 to 98 GB a minute from 20:00Z, against 50 to 65 before the promote.
  • Not the uses being forgotten. I had wondered whether a started worker forgets how often its entries were used. The freer's own lines say no: the batches before the 19:48:13Z start had a median of 0.08 uses and 3,114 s idle, and the three after it 0.52, 0.15 and 0.03 uses at 6,342, 1,802 and 10,558 s idle. What changes at a start is the size of a batch, about 150 entries before and 5,400 to 8,600 after, not what the entries are worth.
  • So why the first batches after a start are thirty to fifty times larger is still unread. What a batch has to cover is the gap less what is on its way, counted by what each free returns, so the candidates are: what counts as on its way right after a start, and what a free is measured to return while a hundred re-attached jobs still share the blobs.

20:25Z: a correction, the third fall's end, and what the freer did all day

Correction of my own reading. kept in the freer's line is not what the cache keeps after a pass. In the code (src/store/freer.rs, the branch returns * 2 < bytes) it counts the candidates a pass looked at and passed over because freeing them returns less than half their count: blobs whose blocks other files share. Every sentence above that reads kept as entries remaining is wrong, the 20:02Z heading "freeing most of what the node kept" included. What the lines do say: a pass is given the 10,000 least-worth blobs (UNLINKS_PER_ROUND, packed_listing in src/store/cas/freeing.rs), and freed plus passed over is about 10,000 in nearly every pass.

The freer's passes by half hour today (3,256 passes from the worker's log; medians):

half hour from passes s between freed passed over as shared GB wanted GB the batch covered GB available
12:00Z 116 6 380 9,579 47 4 1,306
14:00Z 112 5 424 9,585 57 3 1,310
16:00Z 109 4 240 9,756 34 3 1,298
16:30Z 227 4 103 9,893 118 0 1,219
17:00Z 231 3 21 9,983 359 0 987
17:30Z 12 60 2,511 7,744 419 143 456
18:00Z 29 50 2,506 7,290 286 126 655
18:30Z 269 4 79 9,928 234 0 1,109
19:00Z 156 4 93 9,921 486 0 846
19:30Z 146 5 169 9,844 512 1 789
20:00Z 8 190 6,737 3,063 521 469 551
  • Until 16:00Z the volume sits at its keep line (1,319 GB) and a pass covers a few GB.
  • From 16:30Z a pass wants 118 to 512 GB and covers 0: 9,844 to 9,983 of its 10,000 blobs are passed over as mostly shared. Free space slides 1,298, 1,219, 987 GB before the first promote (17:15:44Z), and 1,109, 846, 789 GB between the second and third worker starts. So the volume was already leaving its keep line, with the freer freeing nothing, before each start.
  • After each worker start the same 10,000 are mostly not shared: 2,500 to 8,600 blobs go a pass, the passes minutes apart.
  • Not read: why the 10,000 least-worth blobs are mostly shared in a running worker and mostly not after a start (Cas::returns measures by FIEMAP and measures a sharing blob again whenever store::releases moved, so I do not see a stale answer), and which files share them (running jobs' trees, kept builds, trees still queued in deleting/).

Every pass since the 19:48:13Z start:

pass ended GB available GB freeing blobs freed GB by its count passed over blobs taken in again (mean s after)
19:51:09 772 524 5,419 22 1,064 611 (63)
19:53:11 703 244 8,636 371 1,573 1,515 (116)
20:01:06 730 263 7,372 477 2,028 2,305 (129)
20:05:53 557 308 7,256 461 2,822 1,273 (671)
20:09:41 379 361 7,276 583 2,833 1,009 (245)
20:11:57 306 594 6,823 512 3,293 210 (105)
20:12:53 402 318 6,651 682 3,439 50 (77)
20:15:25 545 561 5,980 24 4,013 728 (574)
20:19:59 680 41 5,546 444 4,783 3,074 (259)

Each batch is the gap the pass read (keep less available less freeing: 579 GB at 20:09:41Z, 583 freed). The store's own counter of blobs unlinked per two minutes: about 100 before the start; 5,020 at 20:02Z, 12,446, 19,154 at 20:10Z, then 6,000 to 9,600.

The third fall. Free on /var/lib/t, read from the worker pod: 459 GB 20:02:37Z, 353 GB 20:06:00Z, 271 GB 20:10:31Z (lowest read), 510 GB 20:12:41Z, 637 GB 20:16Z, 552 to 572 GB at 20:21 to 20:23Z with 540 to 630 trees queued. Under the 440 GB floor for about ten minutes.

  • Two jobs ended at their disk limit, both people's: j613-2526 (cargo check, 20:09:01Z) and j613-2589 (clippy, 20:11:57Z). Both ran again and passed (j613-3169 at 20:16:02Z, j613-4193 at 20:18:32Z).
  • Jobs view 20:11:54Z: 46 people's jobs and one probe ran, no ci job; 544 of people's asks waited for disk, 635 ci asks for room; disk booked 489 GB of 381 offered; the node used 51 of 151 offered cores.

Why the passes are minutes apart: the freer's thread, sampled. Twelve samples four seconds apart, 20:13:20 to 20:14:05Z, all in an uninterruptible wait:

  • 7 in a page fault waiting for the worker's address-space lock (mmap_read_lock_killable < lock_mm_and_find_vma < do_user_addr_fault);
  • 2 in fsync (xfs_file_fsync > xfs_log_force_seq > xlog_cil_force_seq > __flush_workqueue, and xlog_wait_on_iclog), 1 in fdatasync waiting for writeback;
  • 1 in rename (do_renameat2 > dput > __dentry_kill > evict > __flush_work), 1 in pread.
  • The worker then: 874 threads, 13.2 GB of anonymous memory, 3,646 mappings, 42 to 109 child processes named t. In four whole-process samples (20:15 to 20:21Z) one or two t-worker threads were in clone3 (kernel_clone, copy_mnt_ns) while 5 to 20 threads (t-worker, t-deleter, t-kept, t-sampler, t-slot-rm, the freer) waited for the same lock. At 20:06:36Z, three samples: the freer in __flush_workqueue each time.
  • Not read: which call holds the lock for writing. A clone3 that copies the worker's memory map is the candidate; it is the family of my 11-11 note on the nft fork.

I change nothing on the node.

20:35Z: under the floor a fourth time, this time by the delete queue

  • Free on /var/lib/t: 637 GB at 20:16Z, 552 GB 20:21Z, 491 GB 20:28:41Z, 428 to 431 GB from 20:31Z to 20:33Z (floor 440 GB).
  • Trees waiting in deleting/: 0 at 20:17Z, 875 at 20:25:30Z, 1,352 at 20:28:41Z, 1,942 to 1,963 from 20:31Z. By the store's gauge 739 to 765 GB wait to be deleted.
  • The node deleted 475 GB a minute at 20:13Z and 1 to 84 GB a minute from 20:17Z to 20:29Z, while jobs wrote 14 to 38 GB a minute. 1,665 of people's jobs started in the 15 minutes to 20:28Z (issue 97), each end a tree.
  • The deleter's threads, three samples at 20:32 to 20:33Z: 10, then 6 of 17 in unlinkat at __flush_work < evict < do_unlinkat; then 4 in xfs_buf_lock < xfs_read_agi < xfs_iunlink < xfs_remove; the rest idle on a futex. So with nearly 2,000 trees queued, most of the deleter's threads are idle or wait on the file system, and it has one tree in hand (the 19:20Z section above).
  • The disk ceiling gauge went from 1,239 GB to 2,857 GB at 20:20Z, as the queue grew, with 560 GB free.
  • One more set-up failure in these minutes (j613-4622, 20:23:23Z; issue 84).
Since the 17:15:44Z promote of 31934c00 the node's freer finishes a pass every five to six minutes. Before it, a pass came every 3 to 8 seconds. Between passes the node's free disk falls by about 30 GB a minute. No job has failed for disk yet; this is filed while it happens and will be updated. **Passes of the freer on ci-x86-1** (the worker's "freed the least worth of the cache" lines) | when | gap before it | entries freed | bytes freed | kept | freeing | pending | |---|---|---|---|---|---|---| | 17:15:13Z to 17:15:56Z, twelve passes, old build | 3 to 8 s | about 310 a pass | | 9,688 | 312 to 371 GB | 65 to 159 GB | | 17:20:41Z, new build | 285 s | 7,618 | 240 GB | 2,340 | 0 | 0 | | 17:26:41Z, new build | 360 s | 6,958 | 121 GB | 3,030 | 213 GB | 0 | There were 287 passes from 16:55Z to 17:15:56Z, and two in the twelve minutes after. No commit between d748ed8d and 31934c00 touches `src/store/freer.rs`; its `EVERY` is 2 s on both. **Free disk** (my watch on the node, `df` of `/var/lib/t`, with entries in `/var/lib/t/deleting`) | at | free GB | waiting to be deleted | |---|---|---| | 17:19:04Z | 949 | 11 | | 17:21:20Z | 941 | 61 | | 17:23:35Z | 866 | 0 | | 17:25:04Z | 807 | 0 | | 17:26:34Z | 744 | 0 | | 17:27:19Z | 718 | 90 | | 17:28Z | 710 | 0 | Floor 440 GB, keep line 1,319 GB. The volume is 8,587 GB with 7,821 GB used; `t_store_bytes` says 7,793 GB. **What the node shows** (read-only, 17:27Z) - The freer's thread was in state D in `rename`: `xfs_rename`, `xfs_trans_reserve_quota_nblks`, `xfs_trans_dqresv`. The deleter's thread slept in a futex with nothing queued. - The worker has 811 threads: 520 `t-worker`, 271 `t-kept`, 10 `t-ahead`. - Jobs wrote 118 to 134 GB every two minutes both before and after the promote (`t_node_jobs_written_bytes_total`). The node's store deleted 150 to 485 GB every two minutes before it and 18 to 136 GB after (`t_node_store_deleted_bytes_total`). - The freer's lines say blobs were taken in again after being freed: 344 blobs after 86 s on average at 17:20:43Z, and 1,565 after 169 s at 17:26:43Z. **Not read yet** - Why a pass takes minutes on the new worker. Candidates I have not checked: the size of the first passes after a restart (7,000 entries against 310), the quota reservation the rename waits in, and the cold cache's new entries entering the freer's ranking with no uses. - Whether free disk settles above the floor once the old keys' entries are gone. Related: issue 84's new section (a job's set-up waiting in the kernel while the node deletes), and the cold start from the v4 keys. **17:29Z, twelve seconds of samples on the node: what the freer and the deleter wait in.** Free disk 673 GB. | sample | freer thread | deleter thread | |---|---|---| | 1 | D, `fsync` > `xfs_log_force_seq` > `xlog_cil_force_seq` > `__flush_workqueue` | D, `__flush_work` | | 2 | D, the same `fsync` | D, `xfs_qm_dqget_cache_lookup` | | 3 | D, `rename` > `xfs_rename` > `xfs_trans_reserve_quota_nblks` > `xfs_trans_dqresv` | D, `__flush_work` | | 4 | D, `fsync`, log force | D, `__flush_work` | | 5 | D, `fsync`, log force | D, `__flush_work` | | 6 | D, then a futex | D, `__flush_work` | - The freer was never on a CPU in six samples: it waits for the filesystem's log to be forced at each `fsync`, and for a quota reservation at each `rename`. - The worker's other threads in an uninterruptible wait at that moment: 108 `t-worker` in `filename_create`, 7 `t-deleter` in `__flush_work`, 5 `t-worker` in `do_renameat2`, 5 in `__flush_work`, 2 each in `xlog_cil_commit`, `xfs_qm_vop_dqalloc` and `do_rmdir`. - So a hundred threads creating files, the deleter and the freer all wait on the same filesystem at once. The freer's pass is slow because each of its steps queues behind them, not because it computes for long (its CPU time since the worker's start: 2.5 s user, 15.8 s system). - The 255 `t-kept` threads were all asleep. **17:32:02Z, the third pass on the new worker, 321 s after the second.** | pass | entries freed | bytes freed | kept after | freeing | available | needs more free | |---|---|---|---|---|---|---| | 17:20:41Z | 7,618 | 240 GB | 2,340 | 0 | 1,090 GB | 229 GB | | 17:26:41Z | 6,958 | 121 GB | 3,030 | 213 GB | 1,000 GB | 106 GB | | 17:32:02Z | 6,145 | 619 GB | 3,708 | 66 GB | 788 GB | 465 GB | - Three passes say 980 GB freed in sixteen minutes, yet free disk went from 949 GB (17:19Z) to 645 GB (17:31:51Z). - Each pass frees about twice as many entries as it keeps. The kept count grows by about 700 a pass, so most of what the cold start writes between two passes is freed at the next one. The 17:26:43Z line counts 1,565 blobs taken in again 169 s after being freed. - Free disk by my watch: 704 GB at 17:30:21Z, 674 GB at 17:31:06Z, 645 GB at 17:31:51Z. No job has ended for a full disk. **17:37:25Z, the fourth pass, 323 s after the third: it is converging, slowly.** | pass | entries freed | bytes freed | kept after | freeing | available | |---|---|---|---|---|---| | 17:37:25Z | 4,726 | 245 GB | 4,770 | 432 GB | 683 GB | - Entries freed a pass fall (7,618, 6,958, 6,145, 4,726) and entries kept rise (2,340, 3,030, 3,708, 4,770). - The deleter is now the slower half. Entries in `/var/lib/t/deleting` after the third pass: 85, 221, 225, 247, 259, 323 from 17:32:38Z to 17:36:24Z, and 432 GB wait to be deleted after the fourth. - Free disk: 617, 600, 587, 584, 579, 561, 546 GB from 17:32:38Z to 17:37:11Z. The fall slowed from about 30 GB a minute to about 15. - The node's store by Prometheus (`t_store_bytes`): 7,704 GB at 17:18Z, 8,005 GB from 17:28Z, on a volume of 8,587 GB. - The compile cache warms all the same: unit hit rate by five minutes 23%, 52%, 51%, 71% to 17:35Z, against 88.6% before the promote. **17:44Z, on the new worker pod (the old one was deleted at 17:36:47Z, issue 108): free disk 452 GB, twelve above the floor.** - The new worker started at 17:40:11Z. In its first four minutes and 12,235 log lines its freer has logged no pass. - Free disk: 534 GB at 17:38:41Z, 467 GB at 17:43:34Z, 452 GB at 17:44:25Z. Waiting in `/var/lib/t/deleting`: 231, 275, 289 entries. Job directories: 147. - The freer's thread: state D in `fsync` > `xfs_log_force_seq` > `xlog_cil_force_seq` > `__flush_workqueue`, as on the old worker. - The deleter has 17 threads. Fifteen were in state D in `xfs_buf_lock` under `xfs_read_agi` or `xfs_read_agf`, one slept, and four more showed in `__flush_work`. So the deleting threads queue on the locks of the filesystem's allocation groups: more threads do not delete faster. - Jobs view 17:43:44Z: disk offered 499 GB, booked 70 GB; 83 people's, 6 ci and 2 probe jobs running. No job has ended for a full disk in ten minutes. **Where this stands:** the node writes faster than it deletes and is at its floor. What it frees is queued, and what is queued waits on the filesystem. I change nothing on the node. **17:45:50Z: under the floor.** Free 434 GB against a floor of 440 GB. 345 entries wait in `/var/lib/t/deleting`, 102 job directories. The new worker has logged no freer pass in the five and a half minutes since its start. **17:48Z: the floor rule holds so far, and the new worker's first pass has a terabyte queued.** - The new worker's first freer pass ended 17:47:00Z, six minutes and 49 seconds after its start: freed 7,037 entries, kept 2,959, `freeing=1,010 GB`, available 581 GB by its own count. - Free disk read on the node: 417 GB (17:46:28Z), 393 GB (17:47:11Z), 371 GB (17:47:53Z). Entries in `/var/lib/t/deleting`: 352, 359, 364. - The jobs view at 17:48:30Z: the node is healthy and offers 416 GB of disk; 57 ci asks and 28 people's asks wait with kind `disk`. Running: 64 people's, 4 ci, 1 probe. - Jobs ended since free disk went under the floor at 17:45:30Z: people 32 passed, 1 failed, 3 cancelled. None with a cause of t's own. - So the node is not failing jobs for disk. It is 70 GB under its floor with a terabyte chosen and not yet deleted, and the deleter's threads queue on the filesystem's allocation-group locks. **17:50Z: starts have stopped; the running jobs still write more than the node deletes.** Per minute, from Prometheus: | minute | jobs started | GB jobs wrote | GB the node deleted | GB waiting to be deleted | GB offered disk | disk ceiling GB | |---|---|---|---|---|---|---| | 17:43 | 3 | 72 | 57 | 1,010 | 556 | 141 | | 17:45 | 4 | 50 | 22 | 1,010 | 479 | 141 | | 17:47 | 4 | 62 | 113 | 1,010 | 434 | 141 | | 17:48 | 0 | 57 | 40 | 519 | 414 | 0 | | 17:49 | 0 | 64 | 66 | 519 | 399 | 0 | | 17:50 | 0 | 56 | 42 | 519 | 368 | 0 | - Free disk read on the node: 417, 393, 371, 382, 349, 337 GB from 17:46:28Z to 17:49:53Z. About 360 entries stay in `/var/lib/t/deleting`. - The disk ceiling went to 0 at 17:48Z and no job has started since, so the rule that holds starts at the floor works. - The jobs that were already running write 50 to 64 GB a minute, and the node deletes 22 to 113 GB a minute. Free disk falls by the difference until those jobs end. - The node's store by `t_store_bytes`: 8,213 GB, then 8,367 GB from 17:48Z, on a volume of 8,587 GB. **17:56Z: it turned at 240 GB, after two jobs ended for a full disk.** | at | free GB | entries waiting to be deleted | job directories | |---|---|---|---| | 17:51:20Z | 314 | 358 | 66 | | 17:52:03Z | 295 | 792 | 59 | | 17:53:29Z | 265 | 804 | 47 | | 17:54:12Z | 240 | 799 | 42 | | 17:55:33Z | 311 | 262 | 39 | - **Two jobs ended `error | disk_full`:** j612-7866 (`test/tilo-server`, people's, 17:53:42Z) and j612-5170 (`test-x86_64`, people's, 17:54:54Z). They are the only ends with a cause of t's own since the new worker started. - **The second pass** on the new worker ended 17:51:28Z: freed 6,106 entries, 465 GB by its count, kept 4,156. The delete queue then stood near 800 entries for two and a half minutes. - **What the deleter waited in at 17:55Z:** eight of its threads in state D in `unlinkat` > `evict` > `__flush_work`, five in `xfs_buf_lock`. That is the same wait as the job-init of issue 84 in its overlay mount (`evict` > `__flush_work`): dropping an inode on this filesystem waits for a work item, for the deleter as for a job's set-up. - **Then it moved:** the node deleted 127 GB in the minute 17:54Z and 363 GB in 17:55Z, against 2 to 39 GB a minute from 17:48Z to 17:53Z. Running jobs had fallen to about 40 by then. - No job has started since 17:48Z. 123 asks wait with kind `disk`. **What I take from the whole hour, for whoever changes this:** after a restart the freer picks thousands of entries in one pass, and each of its steps and each unlink of the deleter waits on the filesystem behind the jobs' own file creation. Under a cold start's writes the node deletes far slower than it chooses. The floor rule stops starts in time but not the running jobs' writes, and the volume came within 240 GB of full. **17:57Z: recovering, and the two checks were not run again.** - Free disk: 311 GB (17:55:33Z), 430 GB (17:56:06Z), 421 GB (17:56:40Z). Entries waiting to be deleted: 262, 285, 218. - The two checks that ended `error | disk_full` have one job row each and no second job: `test/tilo-server` of run r2377fab35c (job ran 17:44:50Z to 17:53:42Z) and `test-x86_64` of run r2df44d942f (17:40:15Z to 17:54:54Z). So their askers were told an error that was the node's. - No other job has ended for a cause of t's own since 17:55Z. - At 17:56:41Z the node offered 460 GB with 28 people's jobs running; 78 people's asks and 4 ci asks waited with kind `disk`, 68 ci asks for room. **17:58Z: back over the floor, and the freer passes in seconds again.** - Free disk: 404 GB (17:57:13Z), 450 GB (17:57Z), 509 GB (17:58Z). Job directories 32, then 52 and 74: starts have resumed. - The freer's passes on the new worker: | pass ended | gap before it | entries freed | bytes freed | kept | freeing | |---|---|---|---|---|---| | 17:47:00Z | 6 min 49 s from the start | 7,037 | 20 GB | 2,959 | 1,010 GB | | 17:51:28Z | 268 s | 6,106 | 465 GB | 4,156 | 519 GB | | 17:55:58Z | 270 s | 1,779 | 14 GB | 8,220 | 749 GB | | 17:56:46Z | 48 s | 2,128 | 599 GB | 8,477 | 399 GB | | 17:57:35Z | 49 s | 1,596 | 6 GB | 8,404 | 842 GB | | 17:58:06Z | 31 s | 1,774 | 417 GB | 8,589 | 622 GB | | 17:58:22Z | 16 s | 1,610 | 6 GB | 8,390 | 921 GB | - So the pass time followed the load on the filesystem: minutes while a hundred or more jobs wrote, under a minute once about thirty ran. Nothing was changed on the node in between. - The pace of 3 to 8 s from before the promote is not back yet, and each pass still frees 1,600 to 2,100 entries. **18:02Z, correction: three jobs ended for a full disk, not two.** Read again over the whole time since the new worker started, give-backs left out: | ended | job | run | check | class | |---|---|---|---|---| | 17:53:42Z | j612-7866 | r2377fab35c | test/tilo-server | people | | 17:54:54Z | j612-5170 | r2df44d942f | test-x86_64 | people | | 17:57:49Z | j612-4802 | r2df44d942f | test | people | The third ended after the low point, while free disk was back at about 450 GB. No other cause of t's own is on record since 17:40Z. Free disk 507 GB at 18:01:05Z with 738 entries waiting to be deleted. **18:07Z, correction: the checks that ended for disk WERE run again. I read too early.** My 17:57Z section says they were not; that was four minutes before their second jobs started. What the record holds now: | run | check | ended `disk_full` | then | |---|---|---|---| | r2377fab35c | test/tilo-server | j612-7866, 17:53:42Z | j612-8241 passed 18:05:16Z, two more jobs passed 18:05:22Z | | r2df44d942f | test-x86_64 | j612-5170, 17:54:54Z | j612-8246 passed 18:06:03Z | | r2df44d942f | test | j612-4802, 17:57:49Z | j612-8341 failed 18:02:12Z, the check's own outcome | | r2df44d942f | lint-head | j612-5206, 18:04:42Z | queued, waiting for disk, short by 11.4 GB | - So there are four such ends, and no asker is left with an error from them. The cost is the work done twice: these jobs had run 9, 15, 17 and 24 minutes. - What `disk_full` is here, from the server's own lines: "the job ended at its own disk limit, which t booked: 57.9 GiB, holding 57.9 GiB; it runs again booked above both" (j612-4802) and the same for j612-5206 at 4.8 GiB. The job reached its own booking while the node, at its floor, had no room to grow it. The volume itself never filled. - The disk ceiling by minute (`t_node_disk_ceiling_bytes`): 0 from 17:48Z to 17:56Z, then 23, 12, 106, 13, 140, 107, 87, 87, 70 GB, and 0 again at 18:06Z. - Free disk is under the floor again: 449 GB (18:04:45Z), 407 GB (18:05:29Z), 414 GB (18:06:13Z). 85 ci asks and 19 people's asks wait for disk, 516 ci asks for room. **18:13Z: the ends at a disk limit go on with the node back over its floor. Six today, all since the promote.** | ended | job | check | booked | held | booked for the rerun | |---|---|---|---|---|---| | 17:53:42Z | j612-7866 | test/tilo-server | | | | | 17:54:54Z | j612-5170 | test-x86_64 | | | | | 17:57:49Z | j612-4802 | test | 57.9 GiB | 57.9 GiB | 116.9 GiB | | 18:04:42Z | j612-5206 | lint-head | 4.8 GiB | 4.0 GiB | 10.6 GiB | | 18:10:46Z | j612-8386 | test/tilo-server | 31.5 GiB | 30.8 GiB | 64.0 GiB | | 18:11:53Z | j612-8790 | cargo check of four packages | 16.0 GiB | 16.1 GiB | 33.1 GiB | - `job_history` holds no `disk_full` end today before 17:00Z: three in the hour from 17:00Z, three so far in the hour from 18:00Z. A seventh job of the episode ended `cache_unreachable` on the same error inside the wrapper (issue 109). - The last two ended with free disk at 557 to 610 GB and the ceiling at 155 GB, so they are not the floor. The jobs hold what t booked for them, and the rerun is booked at a little over twice that. - My reading, not proven: the bookings were learned from jobs that were handed most of their crates, and under the cold cache with incremental off the same job writes about twice as much before a grow reaches it. The node grew 44 disk quotas from 17:57Z to 18:12Z, 18 of them in 18:11Z and 18:12Z. - Each such end costs the job's time so far: 9 to 24 minutes for the first four, 8 and 3 minutes for the last two. **18:29Z: the disk has recovered, and nothing was changed to make it.** - Free disk: 602 GB (18:21:25Z), 792 GB (18:25:46Z), 953 GB (18:27:12Z), 1,009 GB (18:28:40Z). Entries waiting to be deleted: 453, 347, 46, 50. - No job has ended at its disk limit since 18:11:53Z. The episode's count stays at six `disk_full` and one `cache_unreachable` (issue 109), all run again; I checked the last two reruns in the job rows (one passed, one passed and then failed a later job on its own). - The whole excursion ran from 17:19Z (949 GB) through a low of 240 GB at 17:54:12Z back to 1,009 GB at 18:28:40Z: seventy minutes after a promote that started the cache cold, with the worker pod deleted in the middle of it. - What remains open here is the mechanism, not the state: passes of the freer that take minutes under load, a deleter whose threads queue on the filesystem, and disk bookings about half of what a cold build writes. ## 19:14Z: a second fall, and what the deleter is in the code **The fall.** Free disk held near 900 to 1,200 GB from 18:28Z to 19:03Z and is falling again: | at | free GB | trees waiting in `deleting/` | job directories | |---|---|---|---| | 19:03Z | 901 | 204 | 137 | | 19:06Z | 864 | 522 | 186 | | 19:08Z | 795 | 628 | 259 | | 19:10Z | 755 | 826 | 96 | | 19:12Z | 649 | 1,062 | 85 | | 19:13:37Z | 572 | 954 | 69 | By minute from Prometheus: the node deleted 2 to 104 GB a minute from 19:04Z to 19:08Z (190 to 741 before), jobs wrote 21 to 101 GB a minute, and what waits to be deleted rose from 357 GB (19:03Z) to 742 GB (19:12Z). The freer passes every few seconds again, freeing 95 to 738 entries a pass, keeping about 9,500. **The deleter, read in `src/store/trees.rs` on 31934c00.** - One thread, `Deleter::run` (line 481), takes one tree at a time from its channel and calls `remove_tree(&p, self.threads)`. The next tree waits until that one is gone. - `remove_tree` (line 300) shares that one tree's directories among up to 16 kept threads (`deleter_threads`, cores / 4 clamped to 16). The threads help only inside the tree in hand. - At 19:10:54Z, with 867 trees waiting, 11 of the 17 deleter threads slept on the tree's condition variable and 6 sat in `__flush_work`: the tree in hand had no directory left to hand out, and its unlinks waited on the filesystem. - The module's words size it for big trees: "one thread unlinks about 2.4k files a second, while a busy node's jobs leave trees of 100k–300k files every few seconds". Tonight the queue is counted in trees: the freer hands over hundreds of entries a pass, and every ended job a directory. - The deleter's idle I/O class (`idle_io`, line 69, mine from da6b2851) does nothing on this node: the store is `/dev/md127`, a RAID 0 of NVMe disks whose scheduler is `none`, which ignores classes. So that is not what slows it. **So the mismatch is in the shape of the work:** the queue grows by trees, faster than one tree at a time can be removed whenever an unlink waits on the filesystem, and sixteen threads cannot help across trees. **What would hold "the node deletes at least as fast as it frees":** the idle threads taking the next tree instead of sleeping, or a bound on what the freer hands over against what the deleter has finished. Both are the store's design, and a disk change needs a live-shape test before it ships. I commission nothing without your word; say which you would take. **19:15Z: the second fall turned at 559 GB, above the floor.** Free disk 594 GB (19:13:11Z), 559 GB (19:13:56Z), 608 GB (19:14:12Z), 653 GB (19:14:44Z); trees waiting 1,074, 867, 675, 559. No job ended at its disk limit in it. One job could not be set up at 19:11:31Z, with about a thousand trees queued (j612-14802, `test/tilo-server`; issue 84). ## 20:02Z: a third fall, after the 19:47:42Z promote, and what the three have in common: each worker start is followed by the freer freeing most of what the node kept **The fall.** Free disk 716 GB (19:50Z), 687 (19:55Z), 646 (19:57Z), 611 (19:58Z), 586, 550 GB (20:00:42Z), 498 GB (20:01:26Z). The delete queue this time is nearly empty while it falls: 53, 30, 0, 16 trees. **The freer around each of tonight's three worker starts** (its own lines; "kept" is what it keeps after the pass): | worker start | last passes before it | first passes after it | |---|---|---| | 17:15:59Z, promote | every 3 to 8 s, about 310 entries a pass, kept 9,688 | 17:20:41Z freed 7,618, kept 2,340; 17:26:41Z freed 6,958; 17:32:02Z freed 6,145 | | 17:40:11Z, pod replaced | | 17:47:00Z freed 7,037, kept 2,959; 17:51:28Z freed 6,106 | | 19:48:13Z, promote | 57 passes from 19:42Z to 19:47:54Z, 5 to 20 s apart, 108 to 182 entries a pass, kept about 9,850 | 19:51:09Z freed 5,419 (23 GB), kept 1,064; 19:53:11Z freed 8,636 (372 GB), kept 1,573; 20:01:06Z freed 7,372 (477 GB), kept 2,028 | - A running worker's freer keeps about 9,800 entries and frees 100 to 300 a pass. A freshly started worker's freer frees 5,000 to 8,600 entries a pass, minutes apart, and is down to 1,000 to 3,000 kept within a quarter of an hour. - The second start had no key change and the third moved no compile key, so this is not the old keys' entries being cleared out. - It also frees little for it: 5,419 entries for 23 GB at 19:51:09Z. **What follows from it each time:** thousands of trees for a deleter that removes one at a time, free disk falling, job set-ups waiting beside the unlinks (issue 84), and the node's compile cache thrown away, which the hit rate shows (unit hits fell from 84% to 66% in the ten minutes after the pod replacement). **Not read:** why a started worker's freer values its entries so differently. I am reading `src/store/freer.rs` for what it knows of an entry's uses and sharing after a start, and add it here. **20:04Z: under the floor a second time tonight, and one cause ruled out.** - Free disk: 498 GB (20:01:26Z), 459 GB (20:02:37Z), 437 GB (20:03:11Z), 406 GB (20:03:46Z). The delete queue holds 0 to 17 trees: this fall is not a backlog. The node deleted 251 GB in the minute 20:02Z while jobs wrote 78 to 98 GB a minute from 20:00Z, against 50 to 65 before the promote. - **Not the uses being forgotten.** I had wondered whether a started worker forgets how often its entries were used. The freer's own lines say no: the batches before the 19:48:13Z start had a median of 0.08 uses and 3,114 s idle, and the three after it 0.52, 0.15 and 0.03 uses at 6,342, 1,802 and 10,558 s idle. What changes at a start is the size of a batch, about 150 entries before and 5,400 to 8,600 after, not what the entries are worth. - So why the first batches after a start are thirty to fifty times larger is still unread. What a batch has to cover is the gap less what is on its way, counted by what each free returns, so the candidates are: what counts as on its way right after a start, and what a free is measured to return while a hundred re-attached jobs still share the blobs. ## 20:25Z: a correction, the third fall's end, and what the freer did all day **Correction of my own reading.** `kept` in the freer's line is not what the cache keeps after a pass. In the code (`src/store/freer.rs`, the branch `returns * 2 < bytes`) it counts the candidates a pass looked at and passed over because freeing them returns less than half their count: blobs whose blocks other files share. Every sentence above that reads `kept` as entries remaining is wrong, the 20:02Z heading "freeing most of what the node kept" included. What the lines do say: a pass is given the 10,000 least-worth blobs (`UNLINKS_PER_ROUND`, `packed_listing` in `src/store/cas/freeing.rs`), and freed plus passed over is about 10,000 in nearly every pass. **The freer's passes by half hour today** (3,256 passes from the worker's log; medians): | half hour from | passes | s between | freed | passed over as shared | GB wanted | GB the batch covered | GB available | |---|---|---|---|---|---|---|---| | 12:00Z | 116 | 6 | 380 | 9,579 | 47 | 4 | 1,306 | | 14:00Z | 112 | 5 | 424 | 9,585 | 57 | 3 | 1,310 | | 16:00Z | 109 | 4 | 240 | 9,756 | 34 | 3 | 1,298 | | 16:30Z | 227 | 4 | 103 | 9,893 | 118 | 0 | 1,219 | | 17:00Z | 231 | 3 | 21 | 9,983 | 359 | 0 | 987 | | 17:30Z | 12 | 60 | 2,511 | 7,744 | 419 | 143 | 456 | | 18:00Z | 29 | 50 | 2,506 | 7,290 | 286 | 126 | 655 | | 18:30Z | 269 | 4 | 79 | 9,928 | 234 | 0 | 1,109 | | 19:00Z | 156 | 4 | 93 | 9,921 | 486 | 0 | 846 | | 19:30Z | 146 | 5 | 169 | 9,844 | 512 | 1 | 789 | | 20:00Z | 8 | 190 | 6,737 | 3,063 | 521 | 469 | 551 | - Until 16:00Z the volume sits at its keep line (1,319 GB) and a pass covers a few GB. - From 16:30Z a pass wants 118 to 512 GB and covers 0: 9,844 to 9,983 of its 10,000 blobs are passed over as mostly shared. Free space slides 1,298, 1,219, 987 GB before the first promote (17:15:44Z), and 1,109, 846, 789 GB between the second and third worker starts. So the volume was already leaving its keep line, with the freer freeing nothing, before each start. - After each worker start the same 10,000 are mostly not shared: 2,500 to 8,600 blobs go a pass, the passes minutes apart. - **Not read:** why the 10,000 least-worth blobs are mostly shared in a running worker and mostly not after a start (`Cas::returns` measures by FIEMAP and measures a sharing blob again whenever `store::releases` moved, so I do not see a stale answer), and which files share them (running jobs' trees, kept builds, trees still queued in `deleting/`). **Every pass since the 19:48:13Z start:** | pass ended | GB available | GB freeing | blobs freed | GB by its count | passed over | blobs taken in again (mean s after) | |---|---|---|---|---|---|---| | 19:51:09 | 772 | 524 | 5,419 | 22 | 1,064 | 611 (63) | | 19:53:11 | 703 | 244 | 8,636 | 371 | 1,573 | 1,515 (116) | | 20:01:06 | 730 | 263 | 7,372 | 477 | 2,028 | 2,305 (129) | | 20:05:53 | 557 | 308 | 7,256 | 461 | 2,822 | 1,273 (671) | | 20:09:41 | 379 | 361 | 7,276 | 583 | 2,833 | 1,009 (245) | | 20:11:57 | 306 | 594 | 6,823 | 512 | 3,293 | 210 (105) | | 20:12:53 | 402 | 318 | 6,651 | 682 | 3,439 | 50 (77) | | 20:15:25 | 545 | 561 | 5,980 | 24 | 4,013 | 728 (574) | | 20:19:59 | 680 | 41 | 5,546 | 444 | 4,783 | 3,074 (259) | Each batch is the gap the pass read (keep less available less freeing: 579 GB at 20:09:41Z, 583 freed). The store's own counter of blobs unlinked per two minutes: about 100 before the start; 5,020 at 20:02Z, 12,446, 19,154 at 20:10Z, then 6,000 to 9,600. **The third fall.** Free on /var/lib/t, read from the worker pod: 459 GB 20:02:37Z, 353 GB 20:06:00Z, 271 GB 20:10:31Z (lowest read), 510 GB 20:12:41Z, 637 GB 20:16Z, 552 to 572 GB at 20:21 to 20:23Z with 540 to 630 trees queued. Under the 440 GB floor for about ten minutes. - Two jobs ended at their disk limit, both people's: j613-2526 (cargo check, 20:09:01Z) and j613-2589 (clippy, 20:11:57Z). Both ran again and passed (j613-3169 at 20:16:02Z, j613-4193 at 20:18:32Z). - Jobs view 20:11:54Z: 46 people's jobs and one probe ran, no ci job; 544 of people's asks waited for `disk`, 635 ci asks for room; disk booked 489 GB of 381 offered; the node used 51 of 151 offered cores. **Why the passes are minutes apart: the freer's thread, sampled.** Twelve samples four seconds apart, 20:13:20 to 20:14:05Z, all in an uninterruptible wait: - 7 in a page fault waiting for the worker's address-space lock (`mmap_read_lock_killable < lock_mm_and_find_vma < do_user_addr_fault`); - 2 in `fsync` (`xfs_file_fsync > xfs_log_force_seq > xlog_cil_force_seq > __flush_workqueue`, and `xlog_wait_on_iclog`), 1 in `fdatasync` waiting for writeback; - 1 in `rename` (`do_renameat2 > dput > __dentry_kill > evict > __flush_work`), 1 in `pread`. - The worker then: 874 threads, 13.2 GB of anonymous memory, 3,646 mappings, 42 to 109 child processes named `t`. In four whole-process samples (20:15 to 20:21Z) one or two `t-worker` threads were in `clone3` (`kernel_clone`, `copy_mnt_ns`) while 5 to 20 threads (`t-worker`, `t-deleter`, `t-kept`, `t-sampler`, `t-slot-rm`, the freer) waited for the same lock. At 20:06:36Z, three samples: the freer in `__flush_workqueue` each time. - **Not read:** which call holds the lock for writing. A `clone3` that copies the worker's memory map is the candidate; it is the family of my 11-11 note on the `nft` fork. I change nothing on the node. ## 20:35Z: under the floor a fourth time, this time by the delete queue - Free on /var/lib/t: 637 GB at 20:16Z, 552 GB 20:21Z, 491 GB 20:28:41Z, 428 to 431 GB from 20:31Z to 20:33Z (floor 440 GB). - Trees waiting in `deleting/`: 0 at 20:17Z, 875 at 20:25:30Z, 1,352 at 20:28:41Z, 1,942 to 1,963 from 20:31Z. By the store's gauge 739 to 765 GB wait to be deleted. - The node deleted 475 GB a minute at 20:13Z and 1 to 84 GB a minute from 20:17Z to 20:29Z, while jobs wrote 14 to 38 GB a minute. 1,665 of people's jobs started in the 15 minutes to 20:28Z (issue 97), each end a tree. - The deleter's threads, three samples at 20:32 to 20:33Z: 10, then 6 of 17 in `unlinkat` at `__flush_work < evict < do_unlinkat`; then 4 in `xfs_buf_lock < xfs_read_agi < xfs_iunlink < xfs_remove`; the rest idle on a futex. So with nearly 2,000 trees queued, most of the deleter's threads are idle or wait on the file system, and it has one tree in hand (the 19:20Z section above). - The disk ceiling gauge went from 1,239 GB to 2,857 GB at 20:20Z, as the queue grew, with 560 GB free. - One more set-up failure in these minutes (j613-4622, 20:23:23Z; issue 84).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tilo/t#107
No description provided.