Skip to content

Bar searching or sorting on _seq_no when disabled#143600

Merged
elasticsearchmachine merged 15 commits intoelastic:mainfrom
romseygeek:seqno/disallow-seqno-queries
Mar 6, 2026
Merged

Bar searching or sorting on _seq_no when disabled#143600
elasticsearchmachine merged 15 commits intoelastic:mainfrom
romseygeek:seqno/disallow-seqno-queries

Conversation

@romseygeek
Copy link
Copy Markdown
Contributor

If sequence numbers are trimmed from an index, then it should not be
possible to search or sort against the metadata field.

Related to #136305

If sequence numbers are trimmed from an index, then it should not be
possible to search or sort against the metadata field.
@romseygeek romseygeek requested review from fcofdez and tlrx March 4, 2026 16:38
@romseygeek romseygeek self-assigned this Mar 4, 2026
@romseygeek romseygeek added >non-issue :StorageEngine/Mapping The storage related side of mappings v9.4.0 labels Mar 4, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Copy Markdown
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But maybe it makes sense to have someone from storage engine reviewing this too?

Copy link
Copy Markdown
Member

@tlrx tlrx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left a minor comment

static final class SeqNoFieldType extends SimpleMappedFieldType {
private static final SeqNoFieldType WITH_POINT = new SeqNoFieldType(true);
private static final SeqNoFieldType NO_POINT = new SeqNoFieldType(false);
private static final MappedFieldType UNSEARCHABLE = new UnsearchableFieldType(NAME, CONTENT_TYPE, Map.of());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we somehow mention that the field is not searchable due to sequence numbers being trimmed with DISABLE_SEQUENCE_NUMBERS enabled?

I think that might help troubleshooting why queries fail.

@romseygeek romseygeek requested a review from kkrik-es March 5, 2026 09:54
body:
query:
term:
_seq_no: 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding checks for the error, like

  - match: { error.type: "illegal_argument_exception" }
  - match: { error.reason: "Iterable object is self-referencing itself" }

@romseygeek romseygeek added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • Team:Delivery
  • Team:Search - Inference

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 4e13e53b-a651-4765-a599-f498ece11c2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

romseygeek and others added 5 commits March 6, 2026 10:53
In the stateless architecture, search nodes need search replicas
to serve queries. Setting replicas to 0 prevents search shard
allocation on search nodes.

Made-with: Cursor
@elasticsearchmachine elasticsearchmachine merged commit 58250da into elastic:main Mar 6, 2026
33 checks passed
@romseygeek romseygeek deleted the seqno/disallow-seqno-queries branch March 6, 2026 15:28
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 6, 2026
…locations

* upstream/main: (153 commits)
  ES|QL: Update docs for TOP_SNIPPETS and DECAY (elastic#143739)
  Correctly include endpoint id in log msg in AuthorizationPoller (elastic#143743)
  Bar searching or sorting on _seq_no when disabled (elastic#143600)
  Generalize `testClientCancellation` test (elastic#143586)
  JSON_EXTRACT: zero-copy byte slicing for object, array, and number extraction (elastic#143702)
  Track recycler pages in circuit breaker (elastic#143738)
  [ESQL] Enable distributed pipeline breakers for external sources via FragmentExec (elastic#143696)
  Adding 'mode' and 'codec' fields to ES monitoring template (elastic#143673)
  [ESQL] Columnar I/O and vectorized block conversion for external sources (elastic#143703)
  Fix flaky MMR diversification YAML tests (elastic#143706)
  ES|QL codegen: check builder arguments for vector support (elastic#143724)
  Add Views Security Model (elastic#141050)
  ESQL: Prevent pushdown of unmapped fields in filters and sorts (elastic#143460)
  Don't run seq_no pruning tests in release CI (elastic#143725)
  ESQL: Support intra-row field references in ROW command (elastic#140217)
  ES|QL: Remove implicit limit in FORK branches in CSV tests (elastic#143601)
  IndexRoutingTests with and without synthetic id (elastic#143566)
  Synthetic id upgrade test in serverless (elastic#142471)
  Disable "Review skipped" comments for PRs without specified labels (elastic#143728)
  Cleanup ES|QL T-Digest code duplication, add memory accounting (elastic#143662)
  ...
sidosera pushed a commit to sidosera/elasticsearch that referenced this pull request Mar 6, 2026
If sequence numbers are trimmed from an index, then it should not be 
possible to search or sort against the metadata field.

Related to elastic#136305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants