readcon-db 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {readcon_db-0.2.2 → readcon_db-0.2.3}/CHANGELOG.md +4 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/CITATION.cff +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/Cargo.lock +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/Cargo.toml +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/PKG-INFO +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/explanation/design.org +2 -2
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/campaign.org +10 -9
- {readcon_db-0.2.2 → readcon_db-0.2.3}/fortran/ReadConDb/fpm.toml +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/pixi.toml +1 -1
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/catalog.rs +92 -14
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/shard.rs +116 -46
- readcon_db-0.2.3/tests/claims_shard.rs +203 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/c_lib_tarball.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/ci.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/ci_cxx.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/ci_docs.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/ci_mpi.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/ci_prek.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/crates_publish.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/cxx_tarball.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/lint.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/pages.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.github/workflows/python-wheels.yml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/.gitignore +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/CMakeLists.txt +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/CODE_OF_CONDUCT.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/CONTRIBUTING.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/LICENSE +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/README.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/SECURITY.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/assets/logo/BRAND.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/assets/logo/readcon-db-logo-512.png +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/assets/logo/readcon-db-logo-raster.jpg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/assets/logo/readcon-db-logo.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/assets/logo/readcon-db-wordmark.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/bench/gen_con.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/bench/mpi_bench.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/bench/vary_con.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/cmake/readcon-db-config-version.in.cmake +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/cmake/readcon-db-config.in.cmake +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/cmake/readcon-db.pc.in +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/cmake/tempdir.cmake +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/cog.toml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/Makefile +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/_static/logo.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/changelog.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/contributing/index.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/cooked-soa.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/explanation/architecture.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/explanation/faq.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/explanation/overview.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/atom-order.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/howto.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/install.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/migration.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/mpi.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/streaming.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/topology.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/howto/workflows.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/index.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/readme.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/c.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/citation.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/fortran.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/python-api.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/python.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/reference/rust.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/tutorials/getting-started.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/tutorials/tutorial-run.log +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/tutorials/tutorial-run.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/orgmode/tutorials/tutorial.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/requirements.txt +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/custom.css +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/favicon.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/logo-nav-dark.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/logo-nav-light.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/logo.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_static/mark.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_templates/partials/extra-foot.html +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_templates/partials/extra-head.html +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_templates/partials/site-foot.html +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/_templates/partials/webfonts.html +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/docs/source/conf.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/bench_corpus_ops.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/bench_vs_ase_prep.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/ase_db_bench.json +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/ase_fair_campaign_1.json +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/bench_ase_db.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/db_vs_ase_table.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/fair_campaign.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/fair_db_vs_ase_table.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/readcon_db_bench.json +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/results_merged.json +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/benchmarks/test_fair_select_parity.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/ingest_select.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/mpi_bcast_frame.c +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/mpi_bcast_frame.f90 +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/mpi_bcast_frame.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/mpi_ingest_check.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/mpi_read_check.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/shard_gate.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/workflows/metatrain_from_con.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/examples/workflows/options.metatrain.snippet.yaml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/fortran/README.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/fortran/ReadConDb/src/readcon_db.f90 +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/include/readcon-db-mpi.h +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/include/readcon-db.h +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/lychee.toml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/meson.build +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/meson_options.txt +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/packaging/wrapdb/README.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/packaging/wrapdb/readcon-db.wrap.in +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/freeze/ase_fair_campaign_1.json +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/freeze/fair_db_vs_ase_table.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/readme.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/scripts/gen_fair_table.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/src/appendix-fair-campaign.org +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/paper/cpc/src/figures/generated/fair_campaign_table.tex +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/pixi.lock +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/pr-text.md +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/prek.toml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/pyproject.toml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/pyproject.toml +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_atom_order.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_catalog_claims.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_export_h5md.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_ingest_memory.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_stream_and_random.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/python/tests/test_streaming_guide.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/eon36_lj_dimer.convel +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/sulfolene.con +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/tiny_cuh2.con +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/tiny_cuh2.convel +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/tiny_cuh2_forces.con +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/tiny_cuh2_vel_forces.con +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/resources/test/tiny_multi_cuh2.con +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/assemble-site.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/build-docs.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/check-clib-dist.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/check-cpc-freeze.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/check-cxx-dist.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/check_version_lockstep.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/crate_version.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/export-landing.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/meson_cargo_build.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/package-clib.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/package-cxx.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/release-prep.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/set-version.sh +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/sync-version.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/scripts/test_check_version_lockstep.py +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/archive.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/bin/readcon-db.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/canonical.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/cooked_soa.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/corpus.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/error.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/export_h5md.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/export_xyz.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/ffi.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/frame_codec.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/frame_scalars.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/keys.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/lib.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/mpi_ingest.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/mpi_read.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/mpi_wire.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/python.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/select.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/topology.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/src/units_canon.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/atom_order.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/canonical_dump.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/catalog_claims.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/cli_refuse.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/cmake-project/CMakeLists.txt +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/cmake-project/main.c +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/cooked_soa_authority.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/meson-wrap/main.c +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/meson-wrap/meson.build +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/mpi-c/ingest_smoke.c +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/tests/topology_cli.rs +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/assets/logo.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/assets/wordmark.svg +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/css/site.css +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/export.el +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/index.html +0 -0
- {readcon_db-0.2.2 → readcon_db-0.2.3}/website/index.org +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.2.3 - 2026-11-19
|
|
4
|
+
#### Bug Fixes
|
|
5
|
+
- join and split preserve catalog records and work claims across shards
|
|
6
|
+
|
|
3
7
|
## v0.2.2 - 2026-11-19
|
|
4
8
|
#### Features
|
|
5
9
|
- (**python**) add insert_catalog_record and list_catalog_records - (218ff19) - *HaoZeke*
|
|
@@ -209,7 +209,7 @@ Assign trajectory IDs so ~traj_id % n_shards == shard_id~ (CLI =shard-ingest= ad
|
|
|
209
209
|
:END:
|
|
210
210
|
*KEEP sharded LMDB (Heed).* Single-env multi-writer contradicts LMDB SWMR; HPC-scale uploads use *independent envs per shard* (MDHIM-style local backends / industry sharded-LMDB practice). Full rationale, citations (LMDB docs, MDHIM HotStorage'15, PapyrusKV, RocksDB contrast, HDF5/Zarr/ADIOS2/DAOS contrast), risks, and falsifiers: see the architecture note on sharded LMDB. Do *not* interpret “one write_txn per env” as “LMDB cannot do multi-process writes”---only that *partitioning is mandatory* for concurrent commits.
|
|
211
211
|
|
|
212
|
-
** Compaction:
|
|
212
|
+
** Compaction: join / split for analysis
|
|
213
213
|
:PROPERTIES:
|
|
214
214
|
:CUSTOM_ID: compaction-reversible-join-split-for-analysis
|
|
215
215
|
:END:
|
|
@@ -219,4 +219,4 @@ Assign trajectory IDs so ~traj_id % n_shards == shard_id~ (CLI =shard-ingest= ad
|
|
|
219
219
|
| *single-env-lmdb* | =compact-join= / ordinary =ingest= | Laptop analysis; =ConCorpus::open_readonly= |
|
|
220
220
|
| *extxyz* | =compact-export-extxyz= [--sharded] | External ML tools (non-LMDB) |
|
|
221
221
|
|
|
222
|
-
Join copies CON blobs by traj (ids preserved; duplicate traj across shards errors). Split routes =traj_id % n_shards= into a new manifest root.
|
|
222
|
+
Join copies CON blobs by traj (ids preserved; duplicate traj across shards errors). Split routes =traj_id % n_shards= into a new manifest root. Frame traj_ids round-trip under that routing (indexes rebuilt via normal prepare/commit ingest); split places catalog records and unchanged work claims in shard zero.
|
|
@@ -75,7 +75,7 @@ readcon-db join-drained /lustre/orion/proj/campaign_single \
|
|
|
75
75
|
/lustre/orion/proj/campaign/node_*
|
|
76
76
|
#+end_src
|
|
77
77
|
|
|
78
|
-
=join-drained= requires =shards.json= on every source
|
|
78
|
+
=join-drained= requires =shards.json= on every source and refuses an existing dest. Before creating dest, it refuses traj-id collisions, duplicate catalog identities (namespace, subject, fingerprint), and duplicate work-claim keys (namespace, task). Catalog records and claims use the same policy: an identity present in two sources is an error even when its stored bytes are identical. Give writers disjoint traj id ranges (or disjoint shard sets), catalog identities, and claim keys so join does not collide.
|
|
79
79
|
|
|
80
80
|
=drain= to a dest that already has =shard_XXXX/data.mdb= is an error: two node-local trees that share a shard id must not last-writer-wins.
|
|
81
81
|
|
|
@@ -140,14 +140,15 @@ Same-frame MPI: do *not* open the env on every rank. Rank 0 of the *caller commu
|
|
|
140
140
|
:PROPERTIES:
|
|
141
141
|
:CUSTOM_ID: refuses-do-not-fight-them
|
|
142
142
|
:END:
|
|
143
|
-
| Command
|
|
144
|
-
|
|
145
|
-
| =shard-ingest=
|
|
146
|
-
| =shard-select= / =compact-join=
|
|
147
|
-
| =drain=
|
|
148
|
-
| =join-drained=
|
|
149
|
-
| =compact-join=
|
|
150
|
-
| =compact-
|
|
143
|
+
| Command | Refuse |
|
|
144
|
+
|---------------------------------+---------------------------------------------------------------------------------------------------------------------|
|
|
145
|
+
| =shard-ingest= | missing =shards.json=; =--start-id= not congruent to =--shard= |
|
|
146
|
+
| =shard-select= / =compact-join= | missing root / missing =shards.json= (no mint) |
|
|
147
|
+
| =drain= | missing source =shards.json=; dest =shard_XXXX/data.mdb= already exists; dest =n_shards= mismatch |
|
|
148
|
+
| =join-drained= | dest exists; source lacks =shards.json=; duplicate traj id, catalog identity, or work-claim key |
|
|
149
|
+
| =compact-join= | dest exists; source missing; duplicate traj id, catalog identity, or work-claim key across shards |
|
|
150
|
+
| =compact-split= | dest exists; source missing |
|
|
151
|
+
| =compact-export-extxyz= | sharded root without =--sharded=; dest exists; duplicate traj id, catalog identity, or work-claim key across shards |
|
|
151
152
|
|
|
152
153
|
On refuse, dest is not created (or a partial dest is removed). Tests: =tests/cli_refuse.rs=, =src/shard.rs=.
|
|
153
154
|
|
|
@@ -52,6 +52,18 @@ pub struct CatalogRecord {
|
|
|
52
52
|
pub value: Vec<u8>,
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
pub(crate) struct WorkClaimRecord {
|
|
56
|
+
pub namespace: Vec<u8>,
|
|
57
|
+
pub task: Vec<u8>,
|
|
58
|
+
pub encoded_key: Vec<u8>,
|
|
59
|
+
pub encoded_value: Vec<u8>,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
pub(crate) struct CatalogState {
|
|
63
|
+
pub records: Vec<CatalogRecord>,
|
|
64
|
+
pub claims: Vec<WorkClaimRecord>,
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/// Result of trying to claim a unit of work.
|
|
56
68
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
57
69
|
pub enum ClaimStatus {
|
|
@@ -153,6 +165,24 @@ fn decode_catalog_key(key: &[u8]) -> Result<(&[u8], &[u8], &[u8])> {
|
|
|
153
165
|
Ok((namespace, subject, fingerprint))
|
|
154
166
|
}
|
|
155
167
|
|
|
168
|
+
fn decode_work_key(key: &[u8]) -> Result<(&[u8], &[u8])> {
|
|
169
|
+
let mut rest = key;
|
|
170
|
+
let namespace = take_component(&mut rest, "work claim key")?;
|
|
171
|
+
let task = take_component(&mut rest, "work claim key")?;
|
|
172
|
+
if !rest.is_empty() {
|
|
173
|
+
return Err(Error::Message(
|
|
174
|
+
"corrupt work claim key: trailing bytes".into(),
|
|
175
|
+
));
|
|
176
|
+
}
|
|
177
|
+
validate_component("stored namespace", namespace)?;
|
|
178
|
+
validate_component("stored task", task)?;
|
|
179
|
+
Ok((namespace, task))
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
fn quoted_component(value: &[u8]) -> String {
|
|
183
|
+
format!("{:?}", String::from_utf8_lossy(value))
|
|
184
|
+
}
|
|
185
|
+
|
|
156
186
|
const NANOS_PER_MILLI: u128 = 1_000_000;
|
|
157
187
|
const MILLIS_PER_SEC: u64 = 1_000;
|
|
158
188
|
|
|
@@ -335,23 +365,71 @@ impl ConCorpus {
|
|
|
335
365
|
Ok(records)
|
|
336
366
|
}
|
|
337
367
|
|
|
338
|
-
pub(crate) fn
|
|
339
|
-
let Some(db) = self.catalog_records else {
|
|
340
|
-
return Ok(Vec::new());
|
|
341
|
-
};
|
|
368
|
+
pub(crate) fn catalog_state(&self) -> Result<CatalogState> {
|
|
342
369
|
let txn = self.read_txn()?;
|
|
343
370
|
let mut records = Vec::new();
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
371
|
+
if let Some(db) = self.catalog_records {
|
|
372
|
+
for item in db.iter(&txn)? {
|
|
373
|
+
let (key, value) = item?;
|
|
374
|
+
let (namespace, subject, fingerprint) = decode_catalog_key(key)?;
|
|
375
|
+
records.push(CatalogRecord {
|
|
376
|
+
namespace: namespace.to_vec(),
|
|
377
|
+
subject: subject.to_vec(),
|
|
378
|
+
fingerprint: fingerprint.to_vec(),
|
|
379
|
+
value: value.to_vec(),
|
|
380
|
+
});
|
|
381
|
+
}
|
|
353
382
|
}
|
|
354
|
-
|
|
383
|
+
let mut claims = Vec::new();
|
|
384
|
+
if let Some(db) = self.work_claims {
|
|
385
|
+
for item in db.iter(&txn)? {
|
|
386
|
+
let (key, value) = item?;
|
|
387
|
+
let (namespace, task) = decode_work_key(key)?;
|
|
388
|
+
decode_claim(value)?;
|
|
389
|
+
claims.push(WorkClaimRecord {
|
|
390
|
+
namespace: namespace.to_vec(),
|
|
391
|
+
task: task.to_vec(),
|
|
392
|
+
encoded_key: key.to_vec(),
|
|
393
|
+
encoded_value: value.to_vec(),
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
Ok(CatalogState { records, claims })
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
pub(crate) fn insert_copied_catalog_record(&self, record: &CatalogRecord) -> Result<()> {
|
|
401
|
+
let key = catalog_key(&record.namespace, &record.subject, &record.fingerprint)?;
|
|
402
|
+
validate_record(&record.value)?;
|
|
403
|
+
let db = self.writable_catalog_db()?;
|
|
404
|
+
self.with_write(record.value.len(), |txn| {
|
|
405
|
+
if db.get(txn, &key)?.is_some() {
|
|
406
|
+
return Err(Error::Message(format!(
|
|
407
|
+
"catalog record conflict: namespace {}, subject {}, fingerprint {} appears in more than one source",
|
|
408
|
+
quoted_component(&record.namespace),
|
|
409
|
+
quoted_component(&record.subject),
|
|
410
|
+
quoted_component(&record.fingerprint),
|
|
411
|
+
)));
|
|
412
|
+
}
|
|
413
|
+
db.put(txn, &key, &record.value)?;
|
|
414
|
+
Ok(())
|
|
415
|
+
})
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
pub(crate) fn insert_copied_work_claim(&self, claim: &WorkClaimRecord) -> Result<()> {
|
|
419
|
+
let (namespace, task) = decode_work_key(&claim.encoded_key)?;
|
|
420
|
+
decode_claim(&claim.encoded_value)?;
|
|
421
|
+
let db = self.writable_claims_db()?;
|
|
422
|
+
self.with_write(claim.encoded_value.len(), |txn| {
|
|
423
|
+
if db.get(txn, &claim.encoded_key)?.is_some() {
|
|
424
|
+
return Err(Error::Message(format!(
|
|
425
|
+
"work claim conflict: namespace {}, key {} appears in more than one source",
|
|
426
|
+
quoted_component(namespace),
|
|
427
|
+
quoted_component(task),
|
|
428
|
+
)));
|
|
429
|
+
}
|
|
430
|
+
db.put(txn, &claim.encoded_key, &claim.encoded_value)?;
|
|
431
|
+
Ok(())
|
|
432
|
+
})
|
|
355
433
|
}
|
|
356
434
|
|
|
357
435
|
/// Atomically try to claim one namespaced task for one owner.
|
|
@@ -15,6 +15,7 @@ use std::cell::Cell;
|
|
|
15
15
|
|
|
16
16
|
use readcon_core::types::ConFrame;
|
|
17
17
|
|
|
18
|
+
use crate::catalog::CatalogState;
|
|
18
19
|
use crate::corpus::ConCorpus;
|
|
19
20
|
use crate::error::{Error, Result};
|
|
20
21
|
use crate::keys::{FrameKey, TrajId};
|
|
@@ -584,10 +585,13 @@ impl CorpusExportKind {
|
|
|
584
585
|
}
|
|
585
586
|
|
|
586
587
|
impl ShardedConCorpus {
|
|
587
|
-
/// **Join:** copy all frames from every shard into a
|
|
588
|
-
///
|
|
589
|
-
///
|
|
590
|
-
///
|
|
588
|
+
/// **Join:** copy all frames, catalog records, and work claims from every shard into a
|
|
589
|
+
/// **new single-env** corpus at `dst`. Claim bytes are preserved unchanged. A traj_id,
|
|
590
|
+
/// catalog identity, or claim key appearing in two shards is an error detected before
|
|
591
|
+
/// the destination is created; duplicate catalog records and claims follow the same
|
|
592
|
+
/// refuse policy. Secondary indexes are built via normal append/prepare on each blob.
|
|
593
|
+
/// Frame traj_ids round-trip through [`Self::split_single_to_sharded`] with the same
|
|
594
|
+
/// routing; split places catalog records and unchanged work claims in shard zero.
|
|
591
595
|
pub fn join_to_single_env(&mut self, dst: impl AsRef<Path>) -> Result<u32> {
|
|
592
596
|
let dst = dst.as_ref();
|
|
593
597
|
if dst.exists() {
|
|
@@ -597,21 +601,26 @@ impl ShardedConCorpus {
|
|
|
597
601
|
)));
|
|
598
602
|
}
|
|
599
603
|
self.release_shards();
|
|
600
|
-
let mut
|
|
604
|
+
let mut traj_preview = std::collections::BTreeMap::new();
|
|
605
|
+
let mut catalog_preview = CatalogStatePreview::default();
|
|
606
|
+
let mut states = std::collections::BTreeMap::new();
|
|
601
607
|
for sid in 0..self.n_shards {
|
|
602
608
|
if !self.shard_has_data(sid) {
|
|
603
609
|
continue;
|
|
604
610
|
}
|
|
605
611
|
let c = ConCorpus::open_readonly(self.shard_path(sid))?;
|
|
606
612
|
for fk in c.list_frame_keys()? {
|
|
607
|
-
preview_traj(&mut
|
|
613
|
+
preview_traj(&mut traj_preview, fk.traj_id, u64::from(sid))?;
|
|
608
614
|
}
|
|
615
|
+
let state = c.catalog_state()?;
|
|
616
|
+
preview_catalog_state(&mut catalog_preview, &state)?;
|
|
617
|
+
states.insert(sid, state);
|
|
609
618
|
c.close();
|
|
610
619
|
}
|
|
611
620
|
let n = (|| -> Result<u32> {
|
|
612
621
|
let out = ConCorpus::open(dst)?;
|
|
613
622
|
let mut seen_traj = std::collections::BTreeSet::new();
|
|
614
|
-
let n = append_sharded_into(self, &out, &mut seen_traj)?;
|
|
623
|
+
let n = append_sharded_into(self, &out, &mut seen_traj, &states)?;
|
|
615
624
|
out.close();
|
|
616
625
|
Ok(n)
|
|
617
626
|
})();
|
|
@@ -619,6 +628,8 @@ impl ShardedConCorpus {
|
|
|
619
628
|
}
|
|
620
629
|
|
|
621
630
|
/// Join into a temp single-env, export extxyz, then remove the temp dest.
|
|
631
|
+
/// The join refuses duplicate traj ids, catalog identities, or work-claim
|
|
632
|
+
/// keys across shards before creating that destination.
|
|
622
633
|
pub fn export_extxyz(
|
|
623
634
|
&mut self,
|
|
624
635
|
sel: &Select,
|
|
@@ -654,7 +665,8 @@ impl ShardedConCorpus {
|
|
|
654
665
|
}
|
|
655
666
|
|
|
656
667
|
/// **Split:** read a **single-env** corpus and write a new sharded root at `dst_root`
|
|
657
|
-
/// with `n_shards` (rewrites manifest). Traj_id preserved
|
|
668
|
+
/// with `n_shards` (rewrites manifest). Traj_id is preserved and routed by
|
|
669
|
+
/// `traj_id % n_shards`; catalog records and unchanged work claims live in shard zero.
|
|
658
670
|
pub fn split_single_to_sharded(
|
|
659
671
|
single: &ConCorpus,
|
|
660
672
|
dst_root: impl AsRef<Path>,
|
|
@@ -670,6 +682,7 @@ impl ShardedConCorpus {
|
|
|
670
682
|
dst_root.display()
|
|
671
683
|
)));
|
|
672
684
|
}
|
|
685
|
+
let catalog_state = single.catalog_state()?;
|
|
673
686
|
let n = (|| -> Result<u32> {
|
|
674
687
|
let mut sharded = ShardedConCorpus::open(dst_root, n_shards)?;
|
|
675
688
|
let keys = single.list_frame_keys()?;
|
|
@@ -689,21 +702,19 @@ impl ShardedConCorpus {
|
|
|
689
702
|
n += nf;
|
|
690
703
|
}
|
|
691
704
|
let shard0 = sharded.shard_mut(0)?;
|
|
692
|
-
|
|
705
|
+
copy_catalog_state(&catalog_state, shard0)?;
|
|
693
706
|
Ok(n)
|
|
694
707
|
})();
|
|
695
708
|
rollback_new_dest(dst_root, n)
|
|
696
709
|
}
|
|
697
710
|
}
|
|
698
711
|
|
|
699
|
-
fn
|
|
700
|
-
for record in
|
|
701
|
-
into.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
&record.value,
|
|
706
|
-
)?;
|
|
712
|
+
fn copy_catalog_state(state: &CatalogState, into: &ConCorpus) -> Result<()> {
|
|
713
|
+
for record in &state.records {
|
|
714
|
+
into.insert_copied_catalog_record(record)?;
|
|
715
|
+
}
|
|
716
|
+
for claim in &state.claims {
|
|
717
|
+
into.insert_copied_work_claim(claim)?;
|
|
707
718
|
}
|
|
708
719
|
Ok(())
|
|
709
720
|
}
|
|
@@ -712,6 +723,7 @@ fn append_sharded_into(
|
|
|
712
723
|
sh: &mut ShardedConCorpus,
|
|
713
724
|
out: &ConCorpus,
|
|
714
725
|
seen_traj: &mut std::collections::BTreeSet<u64>,
|
|
726
|
+
states: &std::collections::BTreeMap<u32, CatalogState>,
|
|
715
727
|
) -> Result<u32> {
|
|
716
728
|
let mut n = 0u32;
|
|
717
729
|
for sid in 0..sh.n_shards {
|
|
@@ -738,14 +750,21 @@ fn append_sharded_into(
|
|
|
738
750
|
}
|
|
739
751
|
n += out.append_trajectory_str(tid, &concat, format!("join-from-shard-{sid}"))?;
|
|
740
752
|
}
|
|
741
|
-
|
|
753
|
+
copy_catalog_state(
|
|
754
|
+
states
|
|
755
|
+
.get(&sid)
|
|
756
|
+
.ok_or_else(|| Error::Message(format!("missing shard {sid} catalog state")))?,
|
|
757
|
+
out,
|
|
758
|
+
)?;
|
|
742
759
|
shard.close();
|
|
743
760
|
}
|
|
744
761
|
Ok(n)
|
|
745
762
|
}
|
|
746
763
|
|
|
747
764
|
/// Join several drained sharded roots (unique dests after refuse-overwrite)
|
|
748
|
-
/// into one single-env corpus. Traj ids
|
|
765
|
+
/// into one single-env corpus. Traj ids, catalog identities, and work-claim
|
|
766
|
+
/// keys must be unique across sources; every conflict is found before `dst`
|
|
767
|
+
/// is created.
|
|
749
768
|
pub fn join_drained_roots(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<u32> {
|
|
750
769
|
if sources.is_empty() {
|
|
751
770
|
return Err(Error::Message("join-drained: no sources".into()));
|
|
@@ -765,30 +784,35 @@ pub fn join_drained_roots(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<
|
|
|
765
784
|
)));
|
|
766
785
|
}
|
|
767
786
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
787
|
+
let mut traj_preview = std::collections::BTreeMap::new();
|
|
788
|
+
let mut catalog_preview = CatalogStatePreview::default();
|
|
789
|
+
let mut all_states = Vec::new();
|
|
790
|
+
for (si, src) in sources.iter().enumerate() {
|
|
791
|
+
let sh = ShardedConCorpus::open_existing(src)?;
|
|
792
|
+
let mut states = std::collections::BTreeMap::new();
|
|
793
|
+
for sid in 0..sh.n_shards {
|
|
794
|
+
if !sh.shard_has_data(sid) {
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
797
|
+
let shard = ConCorpus::open_readonly(sh.shard_path(sid))?;
|
|
798
|
+
let owner = ((si as u64) << 32) | u64::from(sid);
|
|
799
|
+
for fk in shard.list_frame_keys()? {
|
|
800
|
+
preview_traj(&mut traj_preview, fk.traj_id, owner)?;
|
|
782
801
|
}
|
|
802
|
+
let state = shard.catalog_state()?;
|
|
803
|
+
preview_catalog_state(&mut catalog_preview, &state)?;
|
|
804
|
+
states.insert(sid, state);
|
|
805
|
+
shard.close();
|
|
783
806
|
}
|
|
807
|
+
all_states.push(states);
|
|
784
808
|
}
|
|
785
809
|
let n = (|| -> Result<u32> {
|
|
786
810
|
let out = ConCorpus::open(dst)?;
|
|
787
811
|
let mut n = 0u32;
|
|
788
812
|
let mut seen = std::collections::BTreeSet::new();
|
|
789
|
-
for src in sources {
|
|
813
|
+
for (src, states) in sources.iter().zip(&all_states) {
|
|
790
814
|
let mut sh = ShardedConCorpus::open_existing(src)?;
|
|
791
|
-
n += append_sharded_into(&mut sh, &out, &mut seen)?;
|
|
815
|
+
n += append_sharded_into(&mut sh, &out, &mut seen, states)?;
|
|
792
816
|
}
|
|
793
817
|
out.close();
|
|
794
818
|
Ok(n)
|
|
@@ -796,7 +820,9 @@ pub fn join_drained_roots(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<
|
|
|
796
820
|
rollback_new_dest(dst, n)
|
|
797
821
|
}
|
|
798
822
|
|
|
799
|
-
/// Join any set of **single-env** corpus directories into one destination
|
|
823
|
+
/// Join any set of **single-env** corpus directories into one destination.
|
|
824
|
+
/// Traj ids, catalog identities, and work-claim keys must be unique across
|
|
825
|
+
/// sources; every conflict is found before `dst` is created.
|
|
800
826
|
pub fn join_corpus_dirs(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<u32> {
|
|
801
827
|
let dst = dst.as_ref();
|
|
802
828
|
if dst.exists() {
|
|
@@ -813,21 +839,24 @@ pub fn join_corpus_dirs(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<u3
|
|
|
813
839
|
)));
|
|
814
840
|
}
|
|
815
841
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
c.close();
|
|
842
|
+
let mut traj_preview = std::collections::BTreeMap::new();
|
|
843
|
+
let mut catalog_preview = CatalogStatePreview::default();
|
|
844
|
+
let mut states = Vec::new();
|
|
845
|
+
for (si, src) in sources.iter().enumerate() {
|
|
846
|
+
let c = ConCorpus::open_readonly(src)?;
|
|
847
|
+
for fk in c.list_frame_keys()? {
|
|
848
|
+
preview_traj(&mut traj_preview, fk.traj_id, si as u64)?;
|
|
824
849
|
}
|
|
850
|
+
let state = c.catalog_state()?;
|
|
851
|
+
preview_catalog_state(&mut catalog_preview, &state)?;
|
|
852
|
+
states.push(state);
|
|
853
|
+
c.close();
|
|
825
854
|
}
|
|
826
855
|
let n = (|| -> Result<u32> {
|
|
827
856
|
let out = ConCorpus::open(dst)?;
|
|
828
857
|
let mut n = 0u32;
|
|
829
858
|
let mut seen = std::collections::BTreeSet::new();
|
|
830
|
-
for src in sources {
|
|
859
|
+
for (src, state) in sources.iter().zip(&states) {
|
|
831
860
|
let c = ConCorpus::open_readonly(src)?;
|
|
832
861
|
let keys = c.list_frame_keys()?;
|
|
833
862
|
let mut by_traj: std::collections::BTreeMap<u64, Vec<FrameKey>> =
|
|
@@ -848,7 +877,7 @@ pub fn join_corpus_dirs(sources: &[PathBuf], dst: impl AsRef<Path>) -> Result<u3
|
|
|
848
877
|
}
|
|
849
878
|
n += out.append_trajectory_str(tid, &concat, src.display().to_string())?;
|
|
850
879
|
}
|
|
851
|
-
|
|
880
|
+
copy_catalog_state(state, &out)?;
|
|
852
881
|
c.close();
|
|
853
882
|
}
|
|
854
883
|
out.close();
|
|
@@ -864,6 +893,47 @@ fn rollback_new_dest<T>(dst: &Path, r: Result<T>) -> Result<T> {
|
|
|
864
893
|
r
|
|
865
894
|
}
|
|
866
895
|
|
|
896
|
+
#[derive(Default)]
|
|
897
|
+
struct CatalogStatePreview {
|
|
898
|
+
records: std::collections::BTreeSet<(Vec<u8>, Vec<u8>, Vec<u8>)>,
|
|
899
|
+
claims: std::collections::BTreeSet<(Vec<u8>, Vec<u8>)>,
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
fn quoted_component(value: &[u8]) -> String {
|
|
903
|
+
format!("{:?}", String::from_utf8_lossy(value))
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
fn preview_catalog_state(preview: &mut CatalogStatePreview, state: &CatalogState) -> Result<()> {
|
|
907
|
+
for record in &state.records {
|
|
908
|
+
let identity = (
|
|
909
|
+
record.namespace.clone(),
|
|
910
|
+
record.subject.clone(),
|
|
911
|
+
record.fingerprint.clone(),
|
|
912
|
+
);
|
|
913
|
+
if !preview.records.insert(identity) {
|
|
914
|
+
return Err(Error::Message(format!(
|
|
915
|
+
"catalog record conflict: namespace {}, subject {}, fingerprint {} appears in more than one source",
|
|
916
|
+
quoted_component(&record.namespace),
|
|
917
|
+
quoted_component(&record.subject),
|
|
918
|
+
quoted_component(&record.fingerprint),
|
|
919
|
+
)));
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
for claim in &state.claims {
|
|
923
|
+
if !preview
|
|
924
|
+
.claims
|
|
925
|
+
.insert((claim.namespace.clone(), claim.task.clone()))
|
|
926
|
+
{
|
|
927
|
+
return Err(Error::Message(format!(
|
|
928
|
+
"work claim conflict: namespace {}, key {} appears in more than one source",
|
|
929
|
+
quoted_component(&claim.namespace),
|
|
930
|
+
quoted_component(&claim.task),
|
|
931
|
+
)));
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
Ok(())
|
|
935
|
+
}
|
|
936
|
+
|
|
867
937
|
/// Record `traj_id` under `owner`. Extra frames of the same traj on the
|
|
868
938
|
/// same owner are fine; the same traj on a different owner is a collision.
|
|
869
939
|
fn preview_traj(
|