@delali/narsil 0.3.1-next.140 → 0.3.1-next.141
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.
- package/dist/{analysis-change-JN23AZQP.mjs → analysis-change-HQUT2Z3I.mjs} +13 -13
- package/dist/{analysis-change-entry-5JSIMEKG.mjs → analysis-change-entry-TZTG4AZB.mjs} +1 -1
- package/dist/browser/{analysis-change-57MIRJWR.mjs → analysis-change-JPV775LR.mjs} +407 -6
- package/dist/browser/{analysis-change-entry-ICGRR3IN.mjs → analysis-change-entry-7HR4LWL3.mjs} +1 -1
- package/dist/browser/chunk-3ZBJYAS4.mjs +19 -0
- package/dist/browser/{chunk-ZAIZQOTM.mjs → chunk-5DB2VDGI.mjs} +951 -1134
- package/dist/browser/chunk-6RHTAVZX.mjs +656 -0
- package/dist/browser/chunk-CCOAOO73.mjs +86 -0
- package/dist/browser/{chunk-3EYDURFD.mjs → chunk-HKX2G6WH.mjs} +1615 -2266
- package/dist/browser/{chunk-CGVBGHBX.mjs → chunk-KTOK275N.mjs} +531 -830
- package/dist/browser/{chunk-5LYWZJE2.mjs → chunk-LVY2LI35.mjs} +1 -1
- package/dist/browser/chunk-MVM33ZUL.mjs +993 -0
- package/dist/browser/chunk-MWUK3DA5.mjs +2634 -0
- package/dist/browser/{chunk-67KSBUYR.mjs → chunk-R4WUDZQV.mjs} +8 -5
- package/dist/browser/{chunk-6BSB4N6B.mjs → chunk-TCLEOZ4P.mjs} +2 -2
- package/dist/browser/chunk-VFYMPCOV.mjs +212 -0
- package/dist/browser/chunk-WCFCHIBB.mjs +177 -0
- package/dist/browser/{chunk-E5SFTOQR.mjs → chunk-XNWPP5NS.mjs} +2 -2
- package/dist/browser/{chunk-QHNNULPW.mjs → chunk-ZEV26AQ6.mjs} +5 -0
- package/dist/browser/cold-module-MJMKNUYJ.mjs +745 -0
- package/dist/browser/{durability-wiring-MTIAN6VT.mjs → durability-wiring-SNOWIT6Z.mjs} +231 -51
- package/dist/browser/{import-Q7MXD6BS.mjs → import-TLB2A5LJ.mjs} +6 -5
- package/dist/browser/module-BUFNZMEU.mjs +12 -0
- package/dist/browser/{module-5J3PEUEB.mjs → module-BVP4TKZU.mjs} +395 -108
- package/dist/{restore-queue-RYSRRFS4.mjs → browser/restore-queue-ONYNYUDE.mjs} +2 -2
- package/dist/browser/{snapshot-YBJ5MF2M.mjs → snapshot-QXBKHJAG.mjs} +108 -25
- package/dist/browser/{write-RTWI5MXL.mjs → write-WHFBDWQS.mjs} +63 -91
- package/dist/{capabilities-DXAmysqJ.d.ts → capabilities-BCdUwK_L.d.ts} +2 -2
- package/dist/{chunk-HMDT3I63.mjs → chunk-46NZOPHS.mjs} +2 -2
- package/dist/{chunk-XXKWEG53.mjs → chunk-5WYVUPGD.mjs} +1 -1
- package/dist/chunk-6SNBQESJ.mjs +214 -0
- package/dist/chunk-7AUASRE7.mjs +653 -0
- package/dist/{chunk-4GCN34JV.mjs → chunk-AST3SHFA.mjs} +26 -24
- package/dist/chunk-BOJZGUS6.mjs +177 -0
- package/dist/{chunk-IP4HJOGC.mjs → chunk-BRUUBXCB.mjs} +4 -3
- package/dist/{chunk-J3EHATEZ.mjs → chunk-DQNKVOJ2.mjs} +63 -63
- package/dist/chunk-FOCV4CBZ.mjs +87 -0
- package/dist/{chunk-FFVLPCLH.mjs → chunk-GLZHNSGB.mjs} +1 -1
- package/dist/chunk-GWOS5DYC.mjs +2637 -0
- package/dist/{chunk-W2XDK66Z.mjs → chunk-IO5F7ZBE.mjs} +112 -438
- package/dist/{chunk-P36MUFEJ.mjs → chunk-JDDXV6UF.mjs} +2 -1
- package/dist/{chunk-LLDFIKGP.mjs → chunk-KEIYVZUX.mjs} +4 -4
- package/dist/{chunk-UBXJQJII.mjs → chunk-KGOXHLLZ.mjs} +5 -1
- package/dist/{chunk-FKARMUWH.mjs → chunk-KZL72VTC.mjs} +68 -16
- package/dist/{chunk-TCWQJL7O.mjs → chunk-L76W3IZJ.mjs} +5 -0
- package/dist/{chunk-CPCGEIOM.mjs → chunk-LA4WNDHL.mjs} +83 -799
- package/dist/{chunk-PNNVTKMT.mjs → chunk-NJJCPFXN.mjs} +2 -2
- package/dist/chunk-NN33CZRE.mjs +86 -0
- package/dist/chunk-NRUXBYPH.mjs +121 -0
- package/dist/{chunk-UJWGQIXU.mjs → chunk-QHPYS427.mjs} +1 -0
- package/dist/{chunk-VSUYTPME.mjs → chunk-RHKRTYGO.mjs} +13 -4
- package/dist/{chunk-UEV53BBO.mjs → chunk-SRJBFG2T.mjs} +406 -5
- package/dist/{chunk-K3AQOZVM.mjs → chunk-TNBIK2LQ.mjs} +1638 -1644
- package/dist/chunk-UUZCQQG2.mjs +209 -0
- package/dist/{chunk-XMQNOD5V.mjs → chunk-VEFN6X6Q.mjs} +2 -2
- package/dist/{chunk-LK3MOTXF.mjs → chunk-VJEGOELZ.mjs} +8 -5
- package/dist/chunk-W2COJ5AH.mjs +148 -0
- package/dist/{chunk-IBATGS3J.mjs → chunk-WJGO5PGV.mjs} +241 -124
- package/dist/{chunk-CCCGEPJM.mjs → chunk-XZ3SRNDJ.mjs} +24 -63
- package/dist/{chunk-MTQTX4BP.mjs → chunk-YHUTF6EA.mjs} +400 -92
- package/dist/{chunk-B5I3IL4H.mjs → chunk-YLNSJQLX.mjs} +4 -4
- package/dist/{chunk-6VHWXAOI.mjs → chunk-Z4HFMYNX.mjs} +29 -24
- package/dist/{chunk-U4X4AWKL.mjs → chunk-ZPWS2SKJ.mjs} +293 -270
- package/dist/{client-DApBeLbk.d.ts → client-B12YFALP.d.ts} +3 -3
- package/dist/client.d.ts +7 -7
- package/dist/cold-module-4X7WJCFM.mjs +783 -0
- package/dist/{config-B0H-vp4U.d.ts → config-BhZxIeb1.d.ts} +6 -1
- package/dist/{config-Brysl9NO.d.ts → config-CIG5yDyg.d.ts} +2 -2
- package/dist/{direct-executor-J5UDLPL3.mjs → direct-executor-7XOQ7VQP.mjs} +5 -5
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution.d.ts +7 -7
- package/dist/distribution.mjs +123 -42
- package/dist/{durability-wiring-AYOTAPNQ.mjs → durability-wiring-324D2DDD.mjs} +213 -40
- package/dist/{engine-CuLMbH1-.d.ts → engine-CtzbHOmG.d.ts} +2 -2
- package/dist/{import-QRZAQ5RH.mjs → import-OOBUW3RR.mjs} +14 -13
- package/dist/{index-HYnqS1SE.d.ts → index-DsEurhSl.d.ts} +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +11 -11
- package/dist/{long-query-thread-U7K5A72G.mjs → long-query-thread-4SW7RWDE.mjs} +8 -8
- package/dist/{module-L2OZO5PQ.mjs → module-DXSJ5LT2.mjs} +374 -83
- package/dist/module-IYPLWHGC.mjs +48 -0
- package/dist/paged-partition-archive-HFP45PLU.mjs +269 -0
- package/dist/partial-words.mjs +2 -2
- package/dist/persistence/durability/checkpoint-worker.d.ts +5 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +17 -15
- package/dist/react.d.ts +9 -9
- package/dist/{browser/restore-queue-DISFECE4.mjs → restore-queue-FEYAC4SB.mjs} +2 -2
- package/dist/{schema-BTXbHCqA.d.ts → schema-B-Runv0n.d.ts} +7 -0
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +8 -7
- package/dist/{snapshot-BTRZ3MZK.mjs → snapshot-CGM65VCD.mjs} +60 -25
- package/dist/{tasks-DjGjK70Y.d.ts → tasks-CjRJRGTb.d.ts} +6 -4
- package/dist/{thread-USB3GOPY.mjs → thread-KGNAIKPD.mjs} +8 -8
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +3 -2
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-GHTA56OW.mjs → write-2DZPEQL2.mjs} +70 -98
- package/openapi.json +13 -0
- package/package.json +12 -8
- package/dist/browser/chunk-XVMOQQ34.mjs +0 -384
- package/dist/chunk-BDIDUW2B.mjs +0 -387
- package/dist/browser/{chunk-4MFH226Q.mjs → chunk-D33A5VMU.mjs} +15 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
2
|
-
import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, e as ScoringMode, a as IndexConfig } from './schema-
|
|
2
|
+
import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, e as ScoringMode, a as IndexConfig } from './schema-B-Runv0n.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Every code a {@link NarsilError} carries, grouped by the part of the engine
|
|
@@ -576,6 +576,11 @@ interface VectorMaintenanceResult {
|
|
|
576
576
|
* room for a second graph beside the one it serves, and false once it starts.
|
|
577
577
|
*/
|
|
578
578
|
waitingForMemory: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* This stays true after a restart while a field kept on disk loads its codes and graph in the
|
|
581
|
+
* background, during which a search reads them from the field's files.
|
|
582
|
+
*/
|
|
583
|
+
loadingFromFiles: boolean;
|
|
579
584
|
/** {@link Narsil.compactVectors} would take about this many milliseconds. */
|
|
580
585
|
estimatedCompactMs: number;
|
|
581
586
|
/** {@link Narsil.optimizeVectors} would take about this many milliseconds. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as NarsilConfig } from './config-
|
|
2
|
-
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-
|
|
1
|
+
import { e as NarsilConfig } from './config-BhZxIeb1.js';
|
|
2
|
+
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-DsEurhSl.js';
|
|
3
3
|
import { N as NodeTransport } from './types-DvncmvuQ.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { createDirectExecutor } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { createDirectExecutor } from './chunk-WJGO5PGV.mjs';
|
|
2
|
+
import './chunk-ZPWS2SKJ.mjs';
|
|
3
3
|
import './chunk-N37VMC62.mjs';
|
|
4
4
|
import './chunk-ZATRDAYU.mjs';
|
|
5
5
|
import './chunk-EBIHRL7B.mjs';
|
|
6
6
|
import './chunk-RKAVHNRW.mjs';
|
|
7
7
|
import './chunk-WQBCBKY3.mjs';
|
|
8
8
|
import './chunk-JUKYYXSP.mjs';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
import './chunk-DQNKVOJ2.mjs';
|
|
10
|
+
import './chunk-KGOXHLLZ.mjs';
|
|
11
11
|
import './chunk-U476IXKQ.mjs';
|
|
12
12
|
import './chunk-FQBFZAWG.mjs';
|
|
13
13
|
import './chunk-VJS4JFBQ.mjs';
|
|
@@ -22,7 +22,7 @@ import './chunk-NPNK57CA.mjs';
|
|
|
22
22
|
import './chunk-4UMZ7KQL.mjs';
|
|
23
23
|
import './chunk-R6A773WK.mjs';
|
|
24
24
|
import './chunk-YTJCGKM4.mjs';
|
|
25
|
-
import './chunk-
|
|
25
|
+
import './chunk-GLZHNSGB.mjs';
|
|
26
26
|
import './chunk-22YPZVMG.mjs';
|
|
27
27
|
import './chunk-L5ORED7V.mjs';
|
|
28
28
|
import './chunk-HNHCNTVG.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClusterCoordinator } from '../../index-
|
|
2
|
-
import '../../schema-
|
|
1
|
+
import { C as ClusterCoordinator } from '../../index-DsEurhSl.js';
|
|
2
|
+
import '../../schema-B-Runv0n.js';
|
|
3
3
|
import '../../adapters-BQFQ4PRz.js';
|
|
4
4
|
import '../../synonyms-CpOAHPa-.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClusterCoordinator } from '../../index-
|
|
2
|
-
import '../../schema-
|
|
1
|
+
import { C as ClusterCoordinator } from '../../index-DsEurhSl.js';
|
|
2
|
+
import '../../schema-B-Runv0n.js';
|
|
3
3
|
import '../../adapters-BQFQ4PRz.js';
|
|
4
4
|
import '../../synonyms-CpOAHPa-.js';
|
|
5
5
|
|
package/dist/distribution.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as CreateIndexOptions, C as ClusterNamespace, c as ClusterNodeConfig } from './config-
|
|
2
|
-
export { d as ClusterControllerConfig, e as ClusterHealth, f as ClusterHealthStatus, g as ClusterMemoryConfig, h as ClusterMetrics, a as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig, V as VectorRebuildWaitFigure } from './config-
|
|
1
|
+
import { b as CreateIndexOptions, C as ClusterNamespace, c as ClusterNodeConfig } from './config-CIG5yDyg.js';
|
|
2
|
+
export { d as ClusterControllerConfig, e as ClusterHealth, f as ClusterHealthStatus, g as ClusterMemoryConfig, h as ClusterMetrics, a as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig, V as VectorRebuildWaitFigure } from './config-CIG5yDyg.js';
|
|
3
3
|
import { R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
4
|
-
import { A as AnalysisChange, N as Narsil } from './engine-
|
|
5
|
-
import { B as BatchResult, L as ListParams, f as ListResult, g as SuggestParams, h as SuggestResult, Q as QueryParams, j as PreflightResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, M as MemoryStats, l as NarsilEventMap, m as QueryResult } from './config-
|
|
6
|
-
import { B as BM25Params, a as IndexConfig, A as AnyDocument, I as InsertOptions } from './schema-
|
|
7
|
-
import { b as NodeCapacity, N as NodeRole } from './index-
|
|
8
|
-
export { d as AllocationConstraints, e as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, c as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-
|
|
4
|
+
import { A as AnalysisChange, N as Narsil } from './engine-CtzbHOmG.js';
|
|
5
|
+
import { B as BatchResult, L as ListParams, f as ListResult, g as SuggestParams, h as SuggestResult, Q as QueryParams, j as PreflightResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, M as MemoryStats, l as NarsilEventMap, m as QueryResult } from './config-BhZxIeb1.js';
|
|
6
|
+
import { B as BM25Params, a as IndexConfig, A as AnyDocument, I as InsertOptions } from './schema-B-Runv0n.js';
|
|
7
|
+
import { b as NodeCapacity, N as NodeRole } from './index-DsEurhSl.js';
|
|
8
|
+
export { d as AllocationConstraints, e as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, c as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-DsEurhSl.js';
|
|
9
9
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
10
10
|
export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
|
|
11
11
|
|
package/dist/distribution.mjs
CHANGED
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { fixedHybridDepthOf, requireWithinHybridDepth, pageByPosition } from './chunk-C3YDYX6C.mjs';
|
|
2
|
+
import { closePartitionWriter, replaySyncedWal } from './chunk-RHKRTYGO.mjs';
|
|
3
|
+
import { archiveStream, buildArchiveFromMemory, memoryCheckpointStore, readSnapshotArchive, writeArchiveFile } from './chunk-KZL72VTC.mjs';
|
|
4
|
+
import { indexMetadataOf, loadPartitionSegments, readSegmentManifest } from './chunk-YHUTF6EA.mjs';
|
|
5
|
+
import { readVectorFile } from './chunk-NRUXBYPH.mjs';
|
|
4
6
|
import { createByteReader } from './chunk-CZQ33DLW.mjs';
|
|
5
|
-
import { DEFAULT_NODE_LIFECYCLE_CONFIG, bindWriteBlockLookup, bindEngineWriteBlock, bindIndexReads, DEFAULT_CONTROLLER_CONFIG, readIndexMetadataSnapshot, indexMetadataSnapshotOf, getIndexMetadata, getClusterIndexConfig, withPartitionCount, validateIndexName, indexConfigFromSettings, metadataWithBm25, indexConfigKey, readIndexState, storeSynonymSet, deleteSynonymSet, indexSettingsOf, putIndexMetadata, isValidInteger, isRecord, isRecord2, decodeIndexSettings, HIDDEN_GENERATION_PREFIX, metadataWithSynonymSet, RESHARD_RECORD_CAS_ATTEMPTS, indexUuidOfStoredMetadata, RESHARD_FORWARD_BATCH_DOCUMENTS, storedSynonymSetOf, RESHARD_RETRY_DELAY_MS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_POLL_INTERVAL_MS, ALLOCATION_RETRY_DELAY_MS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_ROUNDS, ANALYSIS_CHANGE_RETRY_MS, putIndexReplicationFactor, ALLOCATION_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, MAX_RESHARD_CUTOVER_ATTEMPTS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, RECOVERY_CAS_ATTEMPTS, ESTIMATED_PARTITION_BYTES, REBALANCE_THRESHOLD, putGenerationMetadata, RESHARD_CUTOVER_LAG_ENTRIES, ANALYSIS_REBUILD_RESEND_MS, RESHARD_CUTOVER_TIMEOUT_MS, PARTITION_STORES_TIMEOUT_MS, LEADERSHIP_IMBALANCE_THRESHOLD, BOOTSTRAP_CAS_ATTEMPTS } from './chunk-
|
|
6
|
-
import './chunk-TCWQJL7O.mjs';
|
|
7
|
+
import { DEFAULT_NODE_LIFECYCLE_CONFIG, bindWriteBlockLookup, bindEngineWriteBlock, bindIndexReads, DEFAULT_CONTROLLER_CONFIG, readIndexMetadataSnapshot, indexMetadataSnapshotOf, getIndexMetadata, getClusterIndexConfig, withPartitionCount, validateIndexName, indexConfigFromSettings, metadataWithBm25, indexConfigKey, readIndexState, storeSynonymSet, deleteSynonymSet, indexSettingsOf, putIndexMetadata, isValidInteger, isRecord, isRecord2, decodeIndexSettings, HIDDEN_GENERATION_PREFIX, metadataWithSynonymSet, RESHARD_RECORD_CAS_ATTEMPTS, indexUuidOfStoredMetadata, RESHARD_FORWARD_BATCH_DOCUMENTS, storedSynonymSetOf, RESHARD_RETRY_DELAY_MS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_POLL_INTERVAL_MS, ALLOCATION_RETRY_DELAY_MS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_ROUNDS, ANALYSIS_CHANGE_RETRY_MS, putIndexReplicationFactor, ALLOCATION_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, MAX_RESHARD_CUTOVER_ATTEMPTS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, RECOVERY_CAS_ATTEMPTS, ESTIMATED_PARTITION_BYTES, REBALANCE_THRESHOLD, putGenerationMetadata, RESHARD_CUTOVER_LAG_ENTRIES, ANALYSIS_REBUILD_RESEND_MS, RESHARD_CUTOVER_TIMEOUT_MS, PARTITION_STORES_TIMEOUT_MS, LEADERSHIP_IMBALANCE_THRESHOLD, BOOTSTRAP_CAS_ATTEMPTS } from './chunk-BRUUBXCB.mjs';
|
|
7
8
|
import { MAX_WAIT_FOR_ACTIVE_REPLICAS, MIN_CONTROLLER_LEASE_TTL_MS, MAX_NODE_LEFT_DELAY_MS, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_CAPACITY, CATCH_UP_TICK_MS, DEFAULT_RESUME_WRITES_BELOW, DEFAULT_BLOCK_WRITES_ABOVE, readMemoryFigures, createWritePressure, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, MAX_SETTINGS_REPLACEMENT_ATTEMPTS, SETTINGS_CONTENTION_REASON, MAX_DROP_ACKNOWLEDGE_WAIT_MS, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DEFAULT_CREATE_INDEX_WAIT_MS, refuseEncodeWithoutRoom, readRecentMemoryFigures, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, SEARCH_CONTEXT_REAPER_INTERVAL_MS, DECOMMISSION_RECHECK_INTERVAL_MS, answerRefusalOf, withAdmittedWrite, estimateForwardedBytes, CASE_FOLD_EXPANSION_FACTOR, PATTERN_RUN_HEAP_BYTES, ENUM_VALUE_HEAP_BYTES, MAX_SOURCE_ID_LENGTH, DOCUMENT_VALUE_HEAP_BYTES, DOCUMENT_HEAP_BYTES_PER_ESTIMATED_BYTE, DOCUMENT_PROPERTY_HEAP_BYTES, VECTOR_DOCUMENT_HEAP_BYTES, VECTOR_COMPONENT_HEAP_BYTES, NORMALIZATION_EXPANSION_FACTOR, TERM_UNIT_HEAP_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, DISTINCT_TERM_HEAP_BYTES, PARTIAL_SPELLING_HEAP_BYTES, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, CATCH_UP_FEED_WINDOW_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, SYNCED_POSITION_REPORT_TIMEOUT_MS, ADMISSION_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, ROLLBACK_RETRY_DELAY_CAP_MS, COPY_FAILURE_RETRY_DELAY_MS, FETCH_GROUP_DOCUMENT_IDS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, FULL_MEMORY_COLLECTION_INTERVAL_MS, MEMORY_SAMPLE_INTERVAL_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CLEAR_PAGE_SIZE, estimateDocumentsBytes, estimateDocumentBytes, PRIMARY_CHANGE_RETRY_WINDOW_MS, PRIMARY_CHANGE_POLL_INTERVAL_MS, PARTITION_WRITE_CONCURRENCY, FORWARD_RETRY_INITIAL_DELAY_MS, FORWARD_RETRY_DELAY_CAP_MS } from './chunk-DD2673TX.mjs';
|
|
8
9
|
export { DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR } from './chunk-DD2673TX.mjs';
|
|
10
|
+
import './chunk-L76W3IZJ.mjs';
|
|
11
|
+
import './chunk-W2COJ5AH.mjs';
|
|
9
12
|
import { addBackgroundAdmission, workWaitingForMemory } from './chunk-PELHVTO7.mjs';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import { decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-ICW45TTU.mjs';
|
|
13
|
+
import './chunk-Z4HFMYNX.mjs';
|
|
12
14
|
import { onRefusalAfterCollection, reservedHeapBytes, reserveHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-IWVEG5CX.mjs';
|
|
13
|
-
import {
|
|
14
|
-
import './chunk-
|
|
15
|
-
import
|
|
15
|
+
import { decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-ICW45TTU.mjs';
|
|
16
|
+
import { stampAnalysisGeneration, holdsNamedSettings, dropHeldAnalysisChange, releaseHeldAnalysisChange, heldAnalysisIsBuilt, buildHeldAnalysisChange, resolveAnalysisTarget, namedSettingsOf, holdsSettings } from './chunk-SRJBFG2T.mjs';
|
|
17
|
+
import './chunk-VJEGOELZ.mjs';
|
|
16
18
|
import { CONTROLLER_LEASE_KEY } from './chunk-44W3CBNG.mjs';
|
|
17
19
|
import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
|
|
18
|
-
import './chunk-
|
|
20
|
+
import './chunk-TNBIK2LQ.mjs';
|
|
19
21
|
import './chunk-37CD3OKS.mjs';
|
|
20
22
|
import './chunk-DJHHF2L5.mjs';
|
|
21
23
|
import { getPath, getFs } from './chunk-HLPRHOSO.mjs';
|
|
22
|
-
import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload,
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
24
|
+
import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, optionalIndexUuid, computeEntryChecksum, createPrimaryResignMessage, validateInsyncConfirmPayload, buildEntry, createInsyncRemoveMessage, createEntryBatchMessage, createInsyncConfirmMessage, createEntryMessage, validateAckPayload, createInsyncAddMessage, checkpointLastSeqNo, checkpointPrimaryTerm, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage } from './chunk-LA4WNDHL.mjs';
|
|
25
|
+
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
|
|
26
|
+
import './chunk-7AUASRE7.mjs';
|
|
27
|
+
import { directoryCheckpointStore, readListedFile } from './chunk-UUZCQQG2.mjs';
|
|
28
|
+
import { applyIndexEntry, applyDeleteEntry, validateReplicationEntry } from './chunk-KEIYVZUX.mjs';
|
|
25
29
|
import { TransportErrorCodes, ReplicationMessageTypes, ClusterMessageTypes, QueryMessageTypes, TransportError, DEFAULT_TRANSPORT_CONFIG } from './chunk-YH5OIL7B.mjs';
|
|
26
|
-
import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, applyStoredIndexBm25, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, openChecksummedEnvelope, storedArrayPositionGap, emptySerializablePartition, arrayPositionsAreStale, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-
|
|
27
|
-
import { runtimeHost, validateBM25Params, storedBM25Params, requireSurfaceFormsForPartialFields, validateBM25Shape, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-
|
|
28
|
-
import { bindRerankWindowSource, rerankWindowCapOf, providedDocId, engineCoreOf } from './chunk-
|
|
30
|
+
import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, applyStoredIndexBm25, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, openChecksummedEnvelope, storedArrayPositionGap, emptySerializablePartition, arrayPositionsAreStale, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-IO5F7ZBE.mjs';
|
|
31
|
+
import { runtimeHost, validateBM25Params, storedBM25Params, requireSurfaceFormsForPartialFields, validateBM25Shape, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-VEFN6X6Q.mjs';
|
|
32
|
+
import { bindRerankWindowSource, rerankWindowCapOf, providedDocId, engineCoreOf } from './chunk-5WYVUPGD.mjs';
|
|
33
|
+
import './chunk-HJSN7UYG.mjs';
|
|
29
34
|
import './chunk-UIKN2OTQ.mjs';
|
|
30
35
|
import './chunk-AV4IJKD2.mjs';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
36
|
+
import { MAX_DOC_ID_LENGTH, BATCH_CHUNK_SIZE, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING } from './chunk-EEBCDP36.mjs';
|
|
37
|
+
import { synonymModule } from './chunk-WJGO5PGV.mjs';
|
|
38
|
+
import { oversampledShardSize, bm25SetsValue, normalizeSort, sortModesOf, readSortValues, resolveProjection, fnv1a, applyProjection, FILTER_EXPRESSION_KEYS, filterTestCount, setNestedValue, FIELD_FILTER_OPERATORS, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, encodePageCursor, requireWithinResultWindow, holdsQuotedText, sortSignatureEntry, fnv1aUint32s, mergePartitionStats } from './chunk-ZPWS2SKJ.mjs';
|
|
33
39
|
import { generateId } from './chunk-N37VMC62.mjs';
|
|
34
40
|
import './chunk-ZATRDAYU.mjs';
|
|
35
41
|
import './chunk-EBIHRL7B.mjs';
|
|
36
|
-
import './chunk-HJSN7UYG.mjs';
|
|
37
|
-
import { MAX_DOC_ID_LENGTH, BATCH_CHUNK_SIZE, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING } from './chunk-EEBCDP36.mjs';
|
|
38
42
|
import './chunk-KOKM4PQN.mjs';
|
|
39
43
|
import { MIN_OVERSAMPLE } from './chunk-QSK35UC2.mjs';
|
|
40
44
|
import './chunk-74XB2SXI.mjs';
|
|
41
45
|
import { isPatternTolerance } from './chunk-RKAVHNRW.mjs';
|
|
42
46
|
import { MAX_FILTER_DEPTH, MAX_FILTER_TESTS, MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
|
|
43
47
|
import './chunk-JUKYYXSP.mjs';
|
|
44
|
-
import { getNestedValue } from './chunk-
|
|
45
|
-
import { encodeDocument, validateSchema, requireCreatableSchema, encodeDocumentReply, schemaFieldsOf, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES } from './chunk-
|
|
48
|
+
import { getNestedValue } from './chunk-DQNKVOJ2.mjs';
|
|
49
|
+
import { encodeDocument, validateSchema, requireCreatableSchema, encodeDocumentReply, schemaFieldsOf, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES } from './chunk-KGOXHLLZ.mjs';
|
|
46
50
|
import { MAX_DOCUMENT_ENCODING_DEPTH } from './chunk-U476IXKQ.mjs';
|
|
47
51
|
import { MAX_SORT_FIELDS, MAX_CURSOR_LENGTH, MAX_TOLERANCE, MAX_PREFIX_LENGTH, RESULT_WINDOW, MIN_HYBRID_DEPTH, MAX_HYBRID_DEPTH, DEFAULT_PAGE_SIZE, HYBRID_RESCORE_WINDOW } from './chunk-FQBFZAWG.mjs';
|
|
48
52
|
import './chunk-VJS4JFBQ.mjs';
|
|
@@ -58,8 +62,8 @@ import './chunk-4UMZ7KQL.mjs';
|
|
|
58
62
|
import { isSortMode, SORT_MODES, toComparableSortValue, compareComparableKeys, compareSortValues } from './chunk-R6A773WK.mjs';
|
|
59
63
|
import { compareCodePoints, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
60
64
|
import { collectAndReturnPages } from './chunk-RIIUZJQ3.mjs';
|
|
61
|
-
import './chunk-
|
|
62
|
-
import './chunk-
|
|
65
|
+
import './chunk-QHPYS427.mjs';
|
|
66
|
+
import './chunk-GLZHNSGB.mjs';
|
|
63
67
|
import { HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-22YPZVMG.mjs';
|
|
64
68
|
import './chunk-RFBLQLLZ.mjs';
|
|
65
69
|
import { MAX_STORED_VECTOR_DIMENSION, MAX_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
@@ -8337,6 +8341,30 @@ async function archiveReplicationPartition(core, indexName, partitionId, lastSeq
|
|
|
8337
8341
|
const manager = core.requireManager(indexName);
|
|
8338
8342
|
let captured = 0;
|
|
8339
8343
|
const config = await encodeIndexConfiguration(entry);
|
|
8344
|
+
const durable = core.durability?.manager;
|
|
8345
|
+
if (entry.config.textStorage === "disk" && durable?.openArchiveCheckpoint !== void 0) {
|
|
8346
|
+
const checkpoint2 = await durable.openArchiveCheckpoint(indexName);
|
|
8347
|
+
const { directory } = checkpoint2;
|
|
8348
|
+
if (directory === void 0) {
|
|
8349
|
+
checkpoint2.release();
|
|
8350
|
+
throw new NarsilError(
|
|
8351
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
8352
|
+
`Index "${indexName}" stores its text on disk, which needs a durable directory`,
|
|
8353
|
+
{ indexName }
|
|
8354
|
+
);
|
|
8355
|
+
}
|
|
8356
|
+
try {
|
|
8357
|
+
const { openPagedPartitionArchive } = await import('./paged-partition-archive-HFP45PLU.mjs');
|
|
8358
|
+
const archive = await openPagedPartitionArchive(checkpoint2, directory, indexName, partitionId, manager);
|
|
8359
|
+
return {
|
|
8360
|
+
stream: archiveStream({ ...archive, config, sourceIndexName: indexName }),
|
|
8361
|
+
lastSeqNo: archive.lastSeqNo
|
|
8362
|
+
};
|
|
8363
|
+
} catch (error) {
|
|
8364
|
+
checkpoint2.release();
|
|
8365
|
+
throw error;
|
|
8366
|
+
}
|
|
8367
|
+
}
|
|
8340
8368
|
const checkpoint = await buildArchiveFromMemory({
|
|
8341
8369
|
indexName,
|
|
8342
8370
|
metadata: indexMetadataOf(indexName, entry, manager.partitionCount),
|
|
@@ -8371,8 +8399,9 @@ function requireRestoreTarget(indexName, partitionId, partitionCount) {
|
|
|
8371
8399
|
restoreFailed("partitionId is outside partitionCount", { indexName, partitionId, partitionCount });
|
|
8372
8400
|
}
|
|
8373
8401
|
}
|
|
8374
|
-
async function receiveArchive(indexName, partitionId, source, schema) {
|
|
8375
|
-
const store = memoryCheckpointStore();
|
|
8402
|
+
async function receiveArchive(indexName, partitionId, source, schema, directory) {
|
|
8403
|
+
const store = directory === null ? memoryCheckpointStore() : directoryCheckpointStore(directory);
|
|
8404
|
+
const receivedPrefix = directory === null ? `${indexName}/` : `${indexName}/received/p${partitionId}/${generateId()}/`;
|
|
8376
8405
|
let language = "";
|
|
8377
8406
|
let tokenizer;
|
|
8378
8407
|
let stopWords;
|
|
@@ -8405,7 +8434,7 @@ async function receiveArchive(indexName, partitionId, source, schema) {
|
|
|
8405
8434
|
restoreFailed("partition archive holds a graph", { indexName, partitionId });
|
|
8406
8435
|
}
|
|
8407
8436
|
requireSameFlatSchema(indexName, schema, manifest.schema, "partition snapshot");
|
|
8408
|
-
const rename = (key) => `${
|
|
8437
|
+
const rename = (key) => `${receivedPrefix}${key.slice(sourceName.length + 1)}`;
|
|
8409
8438
|
received = {
|
|
8410
8439
|
...manifest,
|
|
8411
8440
|
partitions: manifest.partitions.map((partition) => ({
|
|
@@ -8418,10 +8447,20 @@ async function receiveArchive(indexName, partitionId, source, schema) {
|
|
|
8418
8447
|
}))
|
|
8419
8448
|
};
|
|
8420
8449
|
},
|
|
8421
|
-
file:
|
|
8450
|
+
file: (name, _ref, chunks) => writeArchiveFile(store, `${receivedPrefix}${name}`, chunks)
|
|
8422
8451
|
});
|
|
8423
8452
|
if (received === null) restoreFailed("partition archive holds no manifest", { indexName, partitionId });
|
|
8424
|
-
return {
|
|
8453
|
+
return {
|
|
8454
|
+
language,
|
|
8455
|
+
tokenizer,
|
|
8456
|
+
stopWords,
|
|
8457
|
+
stopWordList,
|
|
8458
|
+
analysisRevision,
|
|
8459
|
+
arrayPositionGap,
|
|
8460
|
+
manifest: received,
|
|
8461
|
+
store,
|
|
8462
|
+
receivedPrefix
|
|
8463
|
+
};
|
|
8425
8464
|
}
|
|
8426
8465
|
function requireArchiveUnderLocalAnalysis(core, indexName, archive) {
|
|
8427
8466
|
const entry = core.requireIndex(indexName);
|
|
@@ -8493,7 +8532,8 @@ async function restoreReplicationPartition(core, engine, indexName, partitionId,
|
|
|
8493
8532
|
const { config: indexConfig, partitionCount, writeRecords } = target;
|
|
8494
8533
|
core.guardShutdown();
|
|
8495
8534
|
requireRestoreTarget(indexName, partitionId, partitionCount);
|
|
8496
|
-
const
|
|
8535
|
+
const directory = indexConfig.textStorage === "disk" ? core.durability?.manager.partitionRegistry?.directory ?? null : null;
|
|
8536
|
+
const archive = await receiveArchive(indexName, partitionId, source, flattenSchema(indexConfig.schema), directory);
|
|
8497
8537
|
let release = core.indexRegistry.has(indexName) ? await core.indexState.acquire(indexName, false) : null;
|
|
8498
8538
|
try {
|
|
8499
8539
|
const restoreIndex = await ensureReplicationIndex(
|
|
@@ -8520,6 +8560,17 @@ async function restoreReplicationPartition(core, engine, indexName, partitionId,
|
|
|
8520
8560
|
try {
|
|
8521
8561
|
await replacePartition(core.requireManager(indexName), partitionId, archive, writeRecords);
|
|
8522
8562
|
recordReceivedAnalysis(core, indexName, archive.analysisRevision, archive.arrayPositionGap);
|
|
8563
|
+
if (directory !== null) {
|
|
8564
|
+
const durable = core.durability?.manager;
|
|
8565
|
+
await (durable?.checkpointFromMemory?.(indexName) ?? durable?.checkpoint(indexName));
|
|
8566
|
+
const { removeReceivedFilesNothingReads } = await import('./paged-partition-archive-HFP45PLU.mjs');
|
|
8567
|
+
await removeReceivedFilesNothingReads(
|
|
8568
|
+
directory,
|
|
8569
|
+
core.requireManager(indexName),
|
|
8570
|
+
partitionId,
|
|
8571
|
+
archive.receivedPrefix
|
|
8572
|
+
);
|
|
8573
|
+
}
|
|
8523
8574
|
} finally {
|
|
8524
8575
|
await core.orchestrator.resyncIndex(indexName, wasScaledOut);
|
|
8525
8576
|
}
|
|
@@ -8728,7 +8779,7 @@ function createClusterWriteRecords() {
|
|
|
8728
8779
|
}
|
|
8729
8780
|
let held = partitions.get(partitionId);
|
|
8730
8781
|
if (held === void 0) {
|
|
8731
|
-
held = { table: createWriteRecordTable(), history: createTermHistory() };
|
|
8782
|
+
held = { table: createWriteRecordTable(), history: createTermHistory(), pagedSegments: [] };
|
|
8732
8783
|
partitions.set(partitionId, held);
|
|
8733
8784
|
}
|
|
8734
8785
|
return held;
|
|
@@ -8739,15 +8790,29 @@ function createClusterWriteRecords() {
|
|
|
8739
8790
|
else held.table.remove(entry.documentId);
|
|
8740
8791
|
held.history.noteEntry(entry.seqNo, entry.primaryTerm);
|
|
8741
8792
|
}
|
|
8742
|
-
function
|
|
8793
|
+
function recordOfDocument(indexName, partitionId, documentId) {
|
|
8794
|
+
const held = indexes.get(indexName)?.get(partitionId);
|
|
8795
|
+
if (held === void 0) return null;
|
|
8796
|
+
const record = held.table.recordOf(documentId);
|
|
8797
|
+
if (record !== null) return record;
|
|
8798
|
+
for (let at = held.pagedSegments.length - 1; at >= 0; at--) {
|
|
8799
|
+
const segment = held.pagedSegments[at];
|
|
8800
|
+
if (!segment.hasDocument(documentId) || segment.paged === null) continue;
|
|
8801
|
+
const stored = segment.paged.writeRecordAt(segment.arrays.idTable.ordinalOf(documentId));
|
|
8802
|
+
return stored.seqNo === 0 ? null : stored;
|
|
8803
|
+
}
|
|
8804
|
+
return null;
|
|
8805
|
+
}
|
|
8806
|
+
function captureSegment(indexName, partitionId, segment) {
|
|
8743
8807
|
const count2 = segment.arrays.documentCount;
|
|
8744
8808
|
const seqNos = new Float64Array(count2);
|
|
8745
8809
|
const primaryTerms = new Float64Array(count2);
|
|
8746
8810
|
for (let ordinal = 0; ordinal < count2; ordinal++) {
|
|
8747
8811
|
if (segment.isTombstoned(ordinal)) continue;
|
|
8748
|
-
const
|
|
8749
|
-
|
|
8750
|
-
|
|
8812
|
+
const record = recordOfDocument(indexName, partitionId, segment.arrays.idTable.idAt(ordinal));
|
|
8813
|
+
if (record === null) continue;
|
|
8814
|
+
seqNos[ordinal] = record.seqNo;
|
|
8815
|
+
primaryTerms[ordinal] = record.primaryTerm;
|
|
8751
8816
|
}
|
|
8752
8817
|
return { seqNos, primaryTerms };
|
|
8753
8818
|
}
|
|
@@ -8758,9 +8823,7 @@ function createClusterWriteRecords() {
|
|
|
8758
8823
|
applied,
|
|
8759
8824
|
replayed: applied,
|
|
8760
8825
|
partition,
|
|
8761
|
-
recordOf
|
|
8762
|
-
return indexes.get(indexName)?.get(partitionId)?.table.recordOf(documentId) ?? null;
|
|
8763
|
-
},
|
|
8826
|
+
recordOf: recordOfDocument,
|
|
8764
8827
|
heldEntry(indexName, partitionId, seqNo, primaryTerm) {
|
|
8765
8828
|
const history = indexes.get(indexName)?.get(partitionId)?.history;
|
|
8766
8829
|
if (history === void 0) return "uncovered";
|
|
@@ -8774,6 +8837,23 @@ function createClusterWriteRecords() {
|
|
|
8774
8837
|
if (held === void 0) return;
|
|
8775
8838
|
held.table.clear();
|
|
8776
8839
|
held.history.clear();
|
|
8840
|
+
held.pagedSegments = [];
|
|
8841
|
+
},
|
|
8842
|
+
loadPagedSegment(indexName, partitionId, segment) {
|
|
8843
|
+
const held = partition(indexName, partitionId);
|
|
8844
|
+
for (const documentId of segment.paged?.snapshot.tombstones ?? []) held.table.remove(documentId);
|
|
8845
|
+
held.pagedSegments = [...held.pagedSegments, segment];
|
|
8846
|
+
},
|
|
8847
|
+
adoptPagedSegments(indexName, partitionId, segments, changed) {
|
|
8848
|
+
const held = partition(indexName, partitionId);
|
|
8849
|
+
const kept = [];
|
|
8850
|
+
for (const documentId of changed) {
|
|
8851
|
+
const record = held.table.recordOf(documentId);
|
|
8852
|
+
if (record !== null) kept.push([documentId, record]);
|
|
8853
|
+
}
|
|
8854
|
+
held.table.clear();
|
|
8855
|
+
for (const [documentId, record] of kept) held.table.set(documentId, record.seqNo, record.primaryTerm);
|
|
8856
|
+
held.pagedSegments = segments;
|
|
8777
8857
|
},
|
|
8778
8858
|
loadSegment(indexName, partitionId, segment, contents) {
|
|
8779
8859
|
const { table } = partition(indexName, partitionId);
|
|
@@ -8788,9 +8868,10 @@ function createClusterWriteRecords() {
|
|
|
8788
8868
|
},
|
|
8789
8869
|
captureSegments(indexName, partitionId, segments) {
|
|
8790
8870
|
const captured = /* @__PURE__ */ new Map();
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8871
|
+
if (indexes.get(indexName)?.get(partitionId) === void 0) return captured;
|
|
8872
|
+
for (const segment of segments) {
|
|
8873
|
+
if (segment.paged === null) captured.set(segment, captureSegment(indexName, partitionId, segment));
|
|
8874
|
+
}
|
|
8794
8875
|
return captured;
|
|
8795
8876
|
},
|
|
8796
8877
|
termHistoryOf(indexName, partitionId, lastSeqNo) {
|