mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
* fix: add MFS operation limit for --flush=false
adds a global counter that tracks consecutive MFS operations performed
with --flush=false and fails with clear error after limit is reached.
this prevents unbounded memory growth while avoiding the data corruption
risks of auto-flushing.
- adds Internal.MFSNoFlushLimit config
- operations fail with actionable error at limit
- counter resets on successful flush or any --flush=true operation
- operations with --flush=true reset and don't count
this commit removes automatic flush from https://github.com/ipfs/kubo/pull/10971
and instead errors to encourage users of --flush=false to develop a habit
of calling 'ipfs files flush' periodically.
boxo will no longer auto-flush (https://github.com/ipfs/boxo/pull/1041) to
avoid corruption issues, and kubo applies the limit to 'ipfs files' commands
instead.
closes #10842
* test: add tests for MFSNoFlushLimit
tests verify the new Internal.MFSNoFlushLimit config option:
- default limit of 256 operations
- custom limit configuration
- counter reset on flush=true
- counter reset on explicit flush command
- limit=0 disables the feature
- multiple MFS command types count towards limit
* docs: explain why MFS operations fail instead of auto-flushing
addresses feedback from https://github.com/ipfs/kubo/pull/10985#pullrequestreview-3256250970
- clarify that automatic flushing at limit was considered but rejected
- explain the data corruption risks of auto-flushing
- guide users who want auto-flush to use --flush=true (default)
- document benefits of explicit failure for batch operations
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| autoconf | ||
| fixtures | ||
| harness | ||
| migrations | ||
| testutils | ||
| add_test.go | ||
| agent_version_unicode_test.go | ||
| backup_bootstrap_test.go | ||
| basic_commands_test.go | ||
| bitswap_config_test.go | ||
| bootstrap_auto_test.go | ||
| cid_test.go | ||
| cli_https_test.go | ||
| commands_without_repo_test.go | ||
| completion_test.go | ||
| content_blocking_test.go | ||
| content_routing_http_test.go | ||
| daemon_test.go | ||
| dag_test.go | ||
| delegated_routing_v1_http_client_test.go | ||
| delegated_routing_v1_http_proxy_test.go | ||
| delegated_routing_v1_http_server_test.go | ||
| dht_autoclient_test.go | ||
| dht_opt_prov_test.go | ||
| files_test.go | ||
| fuse_test.go | ||
| gateway_limits_test.go | ||
| gateway_range_test.go | ||
| gateway_test.go | ||
| http_gateway_over_libp2p_test.go | ||
| http_retrieval_client_test.go | ||
| identity_cid_test.go | ||
| init_test.go | ||
| log_level_test.go | ||
| must.go | ||
| name_test.go | ||
| peering_test.go | ||
| pin_ls_names_test.go | ||
| pin_name_validation_test.go | ||
| ping_test.go | ||
| pinning_remote_test.go | ||
| pins_test.go | ||
| provider_test.go | ||
| rcmgr_test.go | ||
| routing_dht_test.go | ||
| rpc_auth_test.go | ||
| rpc_unixsocket_test.go | ||
| stats_test.go | ||
| swarm_test.go | ||
| telemetry_test.go | ||
| tracing_test.go | ||
| transports_test.go | ||
| webui_test.go | ||