Skip to content

Fix wrong banyanDB resource options in record data#13907

Merged
wu-sheng merged 3 commits into
apache:masterfrom
mrproliu:banyandb-resource-opt
Jun 13, 2026
Merged

Fix wrong banyanDB resource options in record data#13907
wu-sheng merged 3 commits into
apache:masterfrom
mrproliu:banyandb-resource-opt

Conversation

@mrproliu

Copy link
Copy Markdown
Contributor

What's the problem

In MetadataRegistry.parseMetadata, the RECORDS stream-group branch builds its
SchemaMetadata from config.getRecordsBrowserErrorLog() instead of
config.getRecordsNormal():

case RECORDS:
    return new SchemaMetadata(
        namespace,
        BanyanDB.StreamGroup.RECORDS.getName(),   // group = sw_records
        model.getName(),
        Kind.STREAM,
        model.getDownsampling(),
        config.getRecordsBrowserErrorLog()         // <-- wrong: should be recordsNormal
    );

As a result the sw_records group is created/reconciled with the
recordsBrowserErrorLog settings (its shardNum, segmentInterval, ttl,
per-stage warm/cold config) rather than its own records settings. The
RECORDS_LOG and RECORDS_BROWSER_ERROR_LOG branches are already correct; only
RECORDS is affected.

Why it matters

BanyanDBIndexInstaller reconciles a group on startup (init mode) by comparing
every field — including per-stage shardNum / segmentInterval / ttl — and
issues client.update on drift. Because sw_records was being fed the wrong
config object, its group settings silently tracked
SW_STORAGE_BANYANDB_BROWSER_ERROR_LOG_* instead of
SW_STORAGE_BANYANDB_RECORDS_*. In deployments where the two differ (e.g. a
different shardNum), this can drive sw_records to the wrong shard count or
segment-interval grid.

The fix

Point the RECORDS branch at the correct config getter:

config.getRecordsNormal()

One-line change. getRecordsNormal() is the existing Lombok getter for the
recordsNormal field, populated from the records section of bydb.yml
(SW_STORAGE_BANYANDB_RECORDS_*).

Impact

  • sw_records now honors its own records configuration.

  • The RECORDS_LOG / RECORDS_BROWSER_ERROR_LOG groups are untouched.

  • Segment-interval changes only affect newly created segments; existing segments
    keep their grid and no data is rewritten or lost.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.

  • Update the CHANGES log.

@mrproliu mrproliu added this to the 11.0.0 milestone Jun 13, 2026
@mrproliu mrproliu requested review from Copilot and wankai123 June 13, 2026 03:34
@mrproliu mrproliu added the bug Something isn't working and you are sure it's a bug! label Jun 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes BanyanDB schema metadata construction for the RECORDS stream-group so the sw_records group is reconciled/created using the intended records (recordsNormal) configuration, not the browser error log configuration. Also updates the changelog to record the fix.

Changes:

  • Update MetadataRegistry.parseMetadata to use config.getRecordsNormal() for StreamGroup.RECORDS.
  • Add a corresponding entry to docs/en/changes/changes.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/MetadataRegistry.java Fixes RECORDS stream-group schema metadata to use the correct BanyanDB group resource config (recordsNormal).
docs/en/changes/changes.md Documents the BanyanDB records resource-option fix in the changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/en/changes/changes.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wu-sheng wu-sheng merged commit b4bc7ea into apache:master Jun 13, 2026
434 of 439 checks passed
@mrproliu mrproliu deleted the banyandb-resource-opt branch June 13, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants