Repository navigation
Apply additive storage changes at boot on BanyanDB, name the storage stage in StorageManipulationOpt, and log every storage resource's outcome in one place - #14276
Merged
Conversation
wu-sheng
force-pushed
the
boot-additive-schema
branch
from
November 27, 2026 06:34
c03a543 to
b0324ef
Compare
…stage in StorageManipulationOpt, and log every storage resource's outcome in one place
Boot runs unattended in production, so it applies additive storage changes only; a runtime-rule hot update has an
operator, so a breaking change goes through there only with allowStorageChange=true.
- BanyanDB: an init or default-mode OAP applies an additive difference to every measure, stream and trace at boot
(a new tag or field, a tag moving between families except an entity tag), and refuses a breaking one with an
ERROR log; a property takes any change. @BanyanDB.Stream.AllowBootReshape is removed. A resource this boot
updated also gets the index rules it newly declares after a shared one.
- StorageManipulationOpt carries the stage: Stage {BOOT, RUNTIME}; modes BOOT_INSTALL, RUNTIME_APPLY,
RUNTIME_PEER_VERIFY, RUNTIME_LOCAL_ONLY; outcomes MATCHED, CREATED, UPDATED, DROPPED,
BOOT_REFUSED_BREAKING_CHANGE, RUNTIME_PEER_SCHEMA_ABSENT, RUNTIME_PEER_SCHEMA_DIFFERENT,
RUNTIME_BACKEND_UNTOUCHED. The class Javadoc maps where each mode runs in an OAP cluster. A refusal is checked
against the caller's own outcomes only, so one metric's refusal no longer turns off the next metric of a file.
- ModelInstaller logs each storage resource's outcome with its mode and physical name: DEBUG unchanged, INFO
created / updated / dropped, ERROR an incompatible difference left unapplied. Storage plugins log their DDL at
DEBUG. JDBC records the columns and indexes it added, also when a later statement fails; a BanyanDB measure
drop records its TopN aggregations and binding. JDBC and Elasticsearch DDL is unchanged.
wu-sheng
force-pushed
the
boot-additive-schema
branch
from
November 27, 2026 06:34
b0324ef to
3087ce3
Compare
wankai123
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apply additive storage changes at boot on BanyanDB, name the storage stage in
StorageManipulationOpt, and log every storage resource's outcome in one placeBoot runs in production with no operator watching, so it applies additive storage changes only and never a breaking one. A runtime-rule hot update has an operator, so a breaking change goes through there only with
allowStorageChange=true. Hot update only ever changes MAL measures: LAL rules write into record types defined in code.Before this change, BanyanDB did not follow that rule at boot. A measure, stream or trace whose model gained a column in an upgrade was left with its old shape, and the metric stayed off, unless the model class carried
@BanyanDB.Stream.AllowBootReshape(three record types did). JDBC and Elasticsearch already added columns and fields at boot.Boot on BanyanDB
An init or default-mode OAP now applies an additive difference to every measure, stream and trace at boot, and refuses a breaking one with an ERROR log;
@BanyanDB.Stream.AllowBootReshapeis removed.storage-onlyandsearchablefamilies (astorageOnlyflip). An entity tag can't move.JDBC and Elasticsearch behave as before. A new column is added to a JDBC table, and appended to an Elasticsearch index. An Elasticsearch template whose mapping, shard / replica settings or order differ is re-put, and the new definition reaches only the indices created after it. The one ordinary index,
management(ui_template,continuous_profiling_policy,runtimerule), is never re-created, so it keeps its settings; a settings difference there stays the existing WARN.StorageManipulationOpt: the stage is in the declarationThe storage policy now says which stage it serves.
Stage {BOOT, RUNTIME}; modesBOOT_INSTALL,RUNTIME_APPLY,RUNTIME_PEER_VERIFY,RUNTIME_LOCAL_ONLY; factoriesbootInstall(),runtimeApply(),runtimeApplyDeferredFence(...),runtimePeerVerify(),runtimeLocalOnly(). The outcomes name what happened:MATCHED,CREATED,UPDATED,DROPPED,BOOT_REFUSED_BREAKING_CHANGE,RUNTIME_PEER_SCHEMA_ABSENT,RUNTIME_PEER_SCHEMA_DIFFERENT,RUNTIME_BACKEND_UNTOUCHED. TheSKIPPED_*outcomes are gone.The class Javadoc maps where each mode runs in an OAP cluster (OAP role and what it is doing → mode → the outcomes it records), and the mode and outcome docs read the same way, for example "OAP (main, applying
/addOrUpdate) → ..." then "OAP (not-main, starting up) → ...".A refusal is checked against the outcomes of the caller's own registration only:
MetricsStreamProcessoracross all of a metric's downsamplings, andMeterSystem. One opt is shared by a whole MAL file, so an earlier metric's refusal no longer turns off a later one.One storage schema log
ModelInstallerlogs the outcome of every storage resource it checks or changes: a table, an index or template, a BanyanDB group, measure, stream, trace, property, index rule, binding or TopN aggregation. Each line carries the mode and the physical resource name. It logs at DEBUG when the resource is unchanged, at INFO when it was created, updated or dropped, and at ERROR when an incompatible difference was left unapplied. The storage plugins log the DDL they run at DEBUG.Each outcome is recorded where its operation happens. A JDBC table lists the columns and indexes that were added, including when a later statement fails. A BanyanDB measure drop records its TopN aggregations and binding. A not-main OAP's startup check names the table, index, template or
group/nameit found missing or different.Verification
JDBCTableInstallerTestandStorageEsInstallerOrdinaryIndexTest. Checkstyle, the license-header check and the full build with the javadoc check pass.elastic-it) 1,981, all passing.BanyanDBITgains boot tests that assert the stored shapes, rules and bindings: an additive measure, stream and trace; a refused measure and stream; a measure that gains a tag after a rule another measure shares; a not-main OAP's check leaving an additive difference alone, and reporting a shared missing rule for each measure; a measure drop. The only other test changes are the mechanical renames.MATCHED: on BanyanDB 12 groups, 6,705 measures, 26 streams, 3 traces, 3 properties, 146 index rules, 6,265 bindings and 27 TopN aggregations; on MySQL 6,739 tables; on Elasticsearch the templates and themanagementindex. On Elasticsearch without logic sharding it also logged twoUPDATEDre-puts of therecords-alltemplate, which master does on every boot too.AlarmRecord,ServiceTrafficandSegmentRecord, on the same storage. Exactly those resources were updated: on BanyanDB theAlarmRecordstream, theServiceTrafficmeasure and theSegmentRecordtrace, with their 2 new index rules created and 2 bindings updated; on MySQL the 3 tables; on Elasticsearch the 3 templates and the 3 current indices. Each was logged at INFO, with the DDL at DEBUG.allowBootReshape.If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
Update the
CHANGESlog.GraalVM distro impact:
MeterSystem) and a DSL engine (MeterSystem, MAL, TAL).StorageManipulationOpt's factories and outcomes are renamed:schemaCreateIfAbsent()is nowbootInstall(),hasShapeMismatch()is replaced byfirstBootRefusalSince(int)(the outcomes of the caller's own call), andSKIPPED_SHAPE_MISMATCHis nowBOOT_REFUSED_BREAKING_CHANGE. The distro'sMeterSystemreplacement and itsMeterSystemCreateTestuse the old names and need the same change at the next sync.MetricConvertandTALClassGenerator, which the distro's checksums pin, change only in comments and the renamed factory.