- Failed or aborted exports can't be imported: abort() deletes all
time-series files (also the legacy ts_kv.gz), worker Throwables are
counted as failed keys, and the Cassandra exporter now fails like the
PostgreSQL one instead of writing a manifest for a partial export.
- The import rejects a working directory with both ts_kv_manifest.gz and
ts_kv.gz, which are files of two different exports.
- Each worker thread compresses into its own files, rolled over on the
compressed bytes written, so gzip no longer serializes the export.
- Key ids are resolved by name in key_dictionary, so a reused
ts_kv_latest.gz from an earlier export can't map to the wrong key.
- Timestamps near the long bounds are clamped instead of failing the key;
the first page is inclusive instead of using startTs - 1.
- MigrationService stops its workers when start() throws, so the JVM exits
instead of hanging.
- Validated at startup: DATABASE_MAX_POOL_SIZE > PARALLELISM_LEVEL,
Cassandra export start/end filters, TS_KV_EXPORT_MAX_FILE_SIZE_MB >= 0
(new TsKvWriterFactory).
- The query delay applies after every ts_kv query; NaN and Infinity
doubles are imported; part names use Locale.ROOT.
- Tests: PostgreSQL container test for PostgresTsKvExporter, importer
skip_lines across files and non-finite doubles, writer abort/crash/mixed
export cases. README: compatibility with older importers, keys without
latest values, measured cost per key by partition count.
Add PostgresTsKvExporter, so a tenant can be migrated from a PostgreSQL-only
(or TimescaleDB) setup to a hybrid PostgreSQL + Cassandra one. It reads the
history of every key in the exported ts_kv_latest from ts_kv with keyset
pagination and writes it in the CassandraTsKvExporter format, computing the
Cassandra partition from POSTGRES_TS_EXPORT_PARTITIONING (must match the
target's TS_KV_PARTITIONING). Invalid configs fail at startup, and a failed
key makes the export exit with an error without creating data.tar.
Both time-series exporters now write ts_kv_00001.gz, ts_kv_00002.gz, ... of
about TS_KV_EXPORT_MAX_FILE_SIZE_MB (default 256) and a ts_kv_manifest.gz
listing them, written last. The importer reads the manifest (or the legacy
single ts_kv.gz), rejects exports without it, reports progress against the
total row count and applies skip_lines across files. 0 keeps the legacy format.
Also cap the Hikari pool above parallelism_level and document Cassandra 4/5
compatibility (protocol pinning, the 2038 TTL limit).