Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

merge Vinz2168 fix/1092-settings-analysis-echo (CHANGELOG: entry under Unreleased)

xerj-org64c9beba3871
diff --cc CHANGELOG.md
index fcc42cf2c,19dbac936..79ddcebea
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -7,65 -7,31 +7,90 @@@ and this project adheres to [Semantic V
## [Unreleased]
+ ### Fixed
+
+ - **An index's analysis configuration could not be verified over the wire**
+ (issue [#1092](https://github.com/xerj-org/xerj/issues/1092)) — search
+ honoured a declared `analysis.analyzer.default`, but nothing an agent can
+ read said so. `GET /{index}/_settings` and `GET /{index}` replayed an
+ in-memory copy of the create body: after a restart it was empty, so the
+ analysis block (and every other create-time setting) vanished, and a
+ top-level `analysis` beside an `index` block was never echoed at all. Both
+ now report `index.analysis` as the block the index's analyzer registry was
+ actually built from — none for a pre-#204 index whose declared block is
+ not honoured — and fall back to the persisted `settings.json` when the
+ in-memory copy is gone. `POST /{index}/_analyze` was an inline lowercase
+ splitter that ignored the index; it now runs the index's real pipelines:
+ no `analyzer` → the index's default, `field` → the analyzer that field is
+ indexed with, a named analyzer from the index's own registry. Ad-hoc
+ `tokenizer` / `filter` / `char_filter` chains (names or inline
+ definitions) are built by the same registry code index creation uses, with
+ `keyword` as the tokenizer when only filters are given. Unknown analyzers,
+ tokenizers and filters, `field` on the global endpoint and `normalizer`
+ are 400 `illegal_argument_exception`. A missing index is 404. Checked
+ side by side against OpenSearch 3.9.0: status codes, error types, tokens,
+ offsets and positions match on all 24 probed requests. Only the wording of
+ the reason differs on 3 of the 400s.
+
+## [1.0.0-rc.85] - 2026-10-06
+
+The cluster-ring-works window. One defect fix and one docs correction,
+both born from the rc.83 three-node ring tests: the election churn that
+made a ring with a dead peer elect a new leader every ~250 ms forever is
+root-caused and fixed, and the clustering page now describes what the
+ring actually does instead of an unshipped replication design.
+
+### Fixed
+
+- **A ring with a dead peer churned elections forever** (issue
+ [#1168](https://github.com/xerj-org/xerj/issues/1168), PR
+ [#1179](https://github.com/xerj-org/xerj/pull/1179)) — the documented
+ convention lists the full membership in `[cluster] peers` on every
+ node, self included, and nothing removed this node's own entry before
+ the membership reached Raft. Two compounding consequences: the peer
+ count included self, so a three-node ring computed a *four*-member
+ cluster whose majority was three — unanimity, zero fault tolerance —
+ and self was also a routable transport peer, so each candidate sent
+ its own `RequestVote` to itself over loopback TCP where a re-grant
+ counted the self vote **twice**. After the leader died, no survivor
+ could assemble three real votes, and the double-counted self votes
+ let the surviving pair hand each other phantom wins while leapfrogging
+ terms indefinitely. Self is now excluded at three layers (config
+ parse in `main.rs`, `RaftNode::new`, and `TcpTransport::new`), each
+ logging a warning when it fires. Measured on a three-node loopback
+ ring (`tick_ms=50`, kill the leader, 240 s observation): rc.83
+ churned through **94 terms** and never stopped; with the transport
+ starvation fix alone (per-peer outbound queues, first commit on the
+ PR) the churn got *faster* — **909 terms**, which is what pinned the
+ real root cause; with self-exclusion, a new leader is elected
+ **~250 ms** after the kill (one split-vote retry) and the ring then
+ holds **zero elections for the remaining 239 s**, with the second
+ survivor never even timing out. Three new tests, including the ring
+ acceptance scenario `ring_with_full_membership_lists_survives_leader_death`
+ driving three `ClusterNode`s constructed exactly as the server passes
+ the full-membership config.
+
+### Documentation
+
+- **The clustering page described an unshipped replication design**
+ (PR
+ [#1180](https://github.com/xerj-org/xerj/pull/1180), issue
+ [#1170](https://github.com/xerj-org/xerj/issues/1170) context) —
+ `docs/clustering` claimed metadata replication, document replication,
+ node drain/activate/remove endpoints, region split/merge, and a
+ `NodeState` API, none of which exist in the code; it even invented
+ `/_cluster/health` output. The page now states what the ring does
+ today — leader election (~250 ms failover, citing the #1168 fix), an
+ HMAC-authenticated cluster transport with dead-peer isolation, and a
+ durable local Raft log — and says plainly that metadata and document
+ replication are roadmap (#1170), with a "when not to cluster: today,
+ almost always" section. The same sweep corrected the docs-index
+ cards across 29 pages (145 replacements), the troubleshooting
+ election-flapping entry (sustained churn is a *defect* now, not a
+ tuning knob), the rolling-upgrade page (the cluster wire has no
+ version negotiation — full stop/start, not rolling), and the
+ clustered backup section (indexes are node-local today).
+
## [1.0.0-rc.84] - 2026-10-06
The tell-the-truth window. Every signal an operator reads — cluster