Commit Graph
63 Commits
Author SHA1 Message Date
Samuel Cui 1a8f3a8564 test: benchmark the read modes and the cache refresh path
Records two measurements as repeatable benchmarks: the same hash-only read
through the buffered and the mapped source read mode, and the cache
publication path where an unchanged stored hash is compared and left alone
while a changed one is written back. The second pair is what keeps a Scan from
paying a physical attribute write per file.
2026-09-19 02:38:51 +08:00
Samuel Cui 1dc4177e08 test: cover the multi-batch stop and correct the signature test filter
Feeds the exactly-one-callback test through four batches with a recording
source, so the stop assertions cover the items the run actually produced
instead of depending on how far the index raced ahead of the cancel, and
anchors the TESTING.md filter that selects every signature cache test.
2026-09-19 02:15:07 +08:00
Samuel Cui c3bcd856aa feat!: stream caller-owned items and reduce the content options
Replaces the streaming request/result API with caller-owned items and
consolidates the content options, following the Job execution performance
design.

- `Item`, `BatchSource` and `Run` replace `StreamRequest`, `StreamResult`,
  `StreamSource`, `StreamSink` and `RunStream`. Every accepted item receives
  exactly one terminal callback from a single goroutine and without doing
  I/O; an item ACP cannot process reports `Failed`, and a completion carries
  one outcome per requested target in request order with its error identity
  preserved. A graceful stop stops feeding, finishes the items in flight and
  reports the rest, and a hard stop abandons per-item accounting.
- One `HashPolicy` replaces `WithHash`, `WithSignatureCache` and
  `ForceRehash`. A stored hash is read whenever the policy uses the cache,
  reused only where the policy allows it, and refreshed only when it differs.
- A source-only `WithReadMode` selects buffered (the default) or mapped
  reads, and buffered sources open with `O_NOATIME` where the platform has
  it. `LinearDevice` keeps request ordering, append targets and abort-on-error
  but no longer selects the read mode.
- `Overwrite` becomes a target-device option, `WithReadBuffer` sets the read
  buffer, and `SelectFiles` returns the entries the command line copies,
  replacing `AccurateJob`, `WildcardJob` and the walk options.
- Copy consumers share one reference-counted chunk buffer each from a common
  pool, and the per-item write goroutines finish before the result channel
  closes, so no finished item can be dropped.

The command line tools, the documentation and the test suite move with the
API, including semantic tests for the callback contract, the stop and drain
paths, the hash policy matrix and the read modes.
2026-09-19 02:03:34 +08:00
Samuel Cui 8c592a09c8 refactor: publish the queued signature snapshot as-is
The writer no longer re-derives or revalidates live size and mtime around
the xattr write. The reader already compares the stored snapshot against
the file and treats a mismatch as stale, so an entry queued for a version
that has since changed can never read back as a hit, while rewriting it
from live metadata would bind a hash to a version it was not computed for.
The regression test seeds a decoy attribute, asserts that the queued
snapshot lands unchanged, and asserts that the reader reports a miss for a
file whose metadata moved on.
2026-09-19 01:27:22 +08:00
Samuel Cui 2d33662041 feat: preserve request order for linear targets
Concurrent source preparation can no longer reorder writes to a linear
target. Preparation reports one outcome per indexed request; the ordering
stage buffers later outcomes until the request's turn and only then
transfers the reader, so a source waits for its consumer after the
ordering stage has taken it. Skipped and failed requests advance the order
without a write, so one unresolvable source no longer stalls the requests
behind it. Random targets keep completion-order concurrency.
2026-09-19 01:26:59 +08:00
Samuel Cui d097ca107d fix: harden signature cache publication 2026-08-31 22:36:12 +08:00
Samuel Cui cc5248ea33 feat: add content signature xattr cache 2026-08-31 21:17:41 +08:00
Samuel Cui 4eecd3fe31 fix: harden stream failure recovery 2026-08-28 16:08:34 +08:00
Samuel Cui bc886ff506 fix: restore linear target capacity guard 2026-08-28 15:29:29 +08:00
Samuel Cui 44a03f8499 fix: preserve linear target no-space failures 2026-08-28 02:26:41 +08:00
Samuel Cui 75c417497f fix: propagate stream copy failures 2026-08-26 23:25:22 +08:00
Samuel Cui 69cd273054 allow prepared stream results to reorder 2026-08-22 12:35:43 +08:00
Samuel Cui 2122425105 keep source preparation parallel for linear targets 2026-08-22 12:27:13 +08:00
Samuel Cui 202c9d3041 support hash-only streaming jobs 2026-08-21 16:05:48 +08:00
Samuel Cui 4c33c74475 fix copy status handoff before cleanup 2026-08-18 18:30:24 +08:00
Samuel Cui 3fe7bb3702 add bounded streaming copy API 2026-08-17 21:14:42 +08:00
Samuel N Cui f6dde5acb6 test: add library end-to-end coverage 2026-07-11 20:50:30 +08:00
Samuel N Cui 259f124032 fix: harden copy pipeline and testing 2026-07-11 20:45:07 +08:00
Samuel N Cui 207085ec89 feat: change path api 2026-03-13 21:14:47 +08:00
Samuel N Cui 8a8f54c525 feat: add ignore paths 2026-03-11 01:23:37 +08:00
Samuel N Cui 689959e29f feat: add acp-rewrite 2026-03-11 00:55:46 +08:00
Samuel N Cui 2416828cef feat: copy xattrs 2026-03-10 23:20:33 +08:00
Samuel N Cui 4a3bab1fbb feat: add sys attr copy and one to one copy 2026-03-10 21:08:00 +08:00
Samuel N Cui af05f05ce1 feat: get abs before get mount point 2024-03-18 21:39:12 +08:00
Samuel N Cui b13b740940 feat: update godf for bsd 2023-10-04 11:26:18 +08:00
Samuel N Cui b9f8584ad5 fix: no space dev 2023-09-29 20:30:32 +08:00
Samuel N Cui dd07ebc94c feat: add error mapping 2023-09-28 22:33:29 +08:00
Samuel N Cui 457f88d526 fix: error report for disk usage 2023-09-28 03:36:28 +08:00
Samuel N Cui 44b54705fc feat: disk usage add cache 2023-09-28 01:38:14 +08:00
Samuel N Cui 786cd32f8d feat: add consts 2023-09-27 18:12:14 +08:00
Samuel N Cui 5584943c50 feat: change shortcut 2023-09-27 18:07:27 +08:00
Samuel N Cui 5231f1657b fix: large file make ltfs into readonly mode 2023-09-27 17:57:10 +08:00
崔竞宁 0d364575f6 feat: wait for event loop 2023-09-23 00:06:19 +08:00
崔竞宁 18086b0be7 fix: eof for read 2023-09-22 20:57:43 +08:00
崔竞宁 290748251e feat: rename to samuelncui 2023-09-22 13:50:57 +08:00
崔竞宁 de1837a25d feat: don't use mmap from linear device 2023-09-22 13:49:53 +08:00
崔竞宁 fe43945e33 fix: closure variable in loop 2023-09-19 21:05:21 +08:00
崔竞宁 b094d98c63 fix: disable hash when all target is bad 2023-09-18 12:30:59 +08:00
崔竞宁 df6caee408 fix: src nil ptr 2023-05-16 21:32:01 +08:00
崔竞宁 d2c130e974 fix: accurate job not append 2023-05-12 01:31:40 +08:00
崔竞宁 8502bf37dc feat: add wildcard job 2023-05-07 16:19:11 +08:00
崔竞宁 6351045e0f fix: inner error is nil 2022-12-13 18:02:22 +08:00
崔竞宁 913956ff10 fix: stop for no space 2022-12-13 13:45:00 +08:00
崔竞宁 edd8196e43 fix: report json marshal error 2022-12-13 10:58:16 +08:00
崔竞宁 b7a44e4c00 feat: pre read src 2022-12-13 09:38:59 +08:00
崔竞宁 c5de5e5554 feat: add bad dst check 2022-12-12 22:46:14 +08:00
崔竞宁 ae151264e7 feat: add to json string 2022-12-12 01:05:31 +08:00
崔竞宁 7d4accc441 fix: linear 2022-12-08 23:38:37 +08:00
崔竞宁 9fde45f6fd fix: accurate source 2022-12-08 13:30:32 +08:00
崔竞宁 d09399d928 feat: export UnexpectFileMode 2022-12-08 02:48:04 +08:00