Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
* **Breaking Change** — DSL Debug API across OAP nodes: `CollectDebugRecords` replaces `CollectDebugSamples` on the admin gRPC bus (`admin-server.gRPCPort`), which returned a node's whole capture in one reply. During a rolling upgrade, a node reads no records from a node of the other version and shows it as `unreachable` in a debug session's `nodes[]`; a session reads the whole cluster again once every node runs the same version.
* Debug the network-alias pairing of OTLP calls through a new admin module, `trace-pairing-debugging` (`SW_TRACE_PAIRING_DEBUGGING`, on by default, requires `trace-analyzer`). `POST /trace-pairing-debugging/start` turns on one capture per OAP node, shared by every reader, as each node owns a share of the traces; it runs while it is read, and stops a minute after the latest read or on `POST /trace-pairing-debugging/stop`, releasing what it found; each capture from a start to its stop is a round with its own `roundId`, which every node in it shares, and each listed entry names the OAP nodes that hold it. `GET /trace-pairing-debugging/pairings` lists, over the nodes, the peers matched to a server, with the server before it when a later match moved it, the callers, the count of calls and each match's outcome (`registered`, `gateway`, `uncomposed`, `tooLong`, `noService`); and the peers and the servers whose halves left without their pair (`expired`, `evicted`, `replaced`), each with its latest five trace ids.
* BanyanDB: the OAP works with BanyanDB servers reporting API version `0.11` or `0.13`, the versions it supports. The `compatibleServerApiVersions` setting in `bydb.yml` (`SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS`) is removed, as it could list versions the OAP does not support: a server reporting another API version, such as `0.10`, no longer boots even if the setting listed it, and a `bydb.yml` that still sets it boots with a warning. For debugging only, the environment variable `SW_STORAGE_BANYANDB_FORCE_SERVER_API_VERSION` makes the OAP work as one of those versions, whatever version the server reports.
* Fix OAL `maxDouble()` / `minDouble()` failing the OAP boot on Elasticsearch without `logicSharding`: their column is now `double_value`.

#### UI

Expand Down
15 changes: 7 additions & 8 deletions docs/en/concepts-and-designs/runtime-rule-hot-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,26 @@ The "boot never reshapes" rule above applies to **runtime-rule (MAL / LAL)**
registration — those rules ride the `/addOrUpdate` REST workflow when their
backing schema needs to change.

Streams whose schema lives in OAP source code (e.g. `AlarmRecord`) can opt in
to **additive** boot-time reshape via
`@Stream(allowBootReshape = true)`. When the flag is on and the diff is
BanyanDB streams whose schema lives in OAP source code (e.g. `AlarmRecord`) can
opt in to **additive** boot-time reshape via
`@BanyanDB.Stream.AllowBootReshape`. When the stream opts in and the diff is
purely additive, the installer calls `client.update` at boot to extend the
live measure / stream; non-additive divergences still record
live stream; non-additive divergences still record
`SKIPPED_SHAPE_MISMATCH` and require an operator drop+recreate. Only the
init / standalone OAP performs the reshape; non-init peers continue through
the existing poll-and-wait loop so a single node drives DDL during a rolling
restart.

"Additive" includes two cases:

1. **New tag / new field** — a brand-new `@Column` is appended to the live
tag family (or fields list, for measures).
1. **New tag** — a brand-new `@Column` is appended to the live tag family.
2. **Tag relocation between families** — a `@Column`'s `storageOnly` flag
flips, moving the tag between the `storage-only` and `searchable`
families. The tag identity and type are preserved; only its on-disk
family location changes.

Drops, tag-type changes, kind flips (tag↔field), and entity / interval /
sharding-key changes are still rejected with `SKIPPED_SHAPE_MISMATCH`.
Drops, tag-type changes and entity changes are still rejected with
`SKIPPED_SHAPE_MISMATCH`.

When the primary `check*` records `SKIPPED_SHAPE_MISMATCH`, the dependent
`IndexRule` and `IndexRuleBinding` reconciliation is **also skipped**. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private Class generateMetricsClass(CodeGenModel model) throws OALCompileExceptio

if (field.isID()) {
// Add SeriesID annotation
Annotation banyanSeriesIDAnnotation = new Annotation(BanyanDB.SeriesID.class.getName(), constPool);
Annotation banyanSeriesIDAnnotation = new Annotation(BanyanDB.Measure.SeriesID.class.getName(), constPool);
banyanSeriesIDAnnotation.addMemberValue("index", new IntegerMemberValue(constPool, 0));
annotationsAttribute.addAnnotation(banyanSeriesIDAnnotation);

Expand All @@ -269,7 +269,7 @@ private Class generateMetricsClass(CodeGenModel model) throws OALCompileExceptio
}

if (field.isShardingKey()) {
Annotation banyanShardingKeyAnnotation = new Annotation(BanyanDB.ShardingKey.class.getName(), constPool);
Annotation banyanShardingKeyAnnotation = new Annotation(BanyanDB.Measure.ShardingKey.class.getName(), constPool);
banyanShardingKeyAnnotation.addMemberValue("index", new IntegerMemberValue(constPool, field.getShardingKeyIdx()));
annotationsAttribute.addAnnotation(banyanShardingKeyAnnotation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
@Getter
@Setter
@ScopeDeclaration(id = ALARM, name = "Alarm")
@Stream(name = AlarmRecord.INDEX_NAME, scopeId = DefaultScopeDefine.ALARM, builder = AlarmRecord.Builder.class, processor = RecordStreamProcessor.class, allowBootReshape = true)
@Stream(name = AlarmRecord.INDEX_NAME, scopeId = DefaultScopeDefine.ALARM, builder = AlarmRecord.Builder.class, processor = RecordStreamProcessor.class)
@BanyanDB.Stream.AllowBootReshape
@SQLDatabase.ExtraColumn4AdditionalEntity(additionalTable = AlarmRecord.ADDITIONAL_TAG_TABLE, parentColumn = TIME_BUCKET)
@BanyanDB.TimestampColumn(AlarmRecord.START_TIME)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(AlarmRecord.START_TIME)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class AlarmRecord extends Record {
public static final String INDEX_NAME = "alarm_record";
public static final String ADDITIONAL_TAG_TABLE = "alarm_record_tag";
Expand Down Expand Up @@ -79,7 +80,7 @@ public StorageID id() {
// (id1) IDs. Indexed (storageOnly removed in 11.0.0) so `queryAlarms` can
// filter alarms by serviceId / instanceId / endpointId / relation ends.
@Column(name = ID0, length = 512)
@BanyanDB.SeriesID(index = 0)
@BanyanDB.Stream.SeriesID(index = 0)
private String id0;
@Column(name = ID1)
private String id1;
Expand All @@ -88,11 +89,12 @@ public StorageID id() {
private long startTime;
@Column(name = ALARM_MESSAGE, length = 512)
@ElasticSearch.MatchQuery
@BanyanDB.MatchQuery(analyzer = BanyanDB.MatchQuery.AnalyzerType.SIMPLE)
@BanyanDB.Stream.MatchQuery(analyzer = BanyanDB.AnalyzerType.SIMPLE)
private String alarmMessage;
@Column(name = RULE_NAME)
private String ruleName;
@Column(name = TAGS, indexOnly = true)
@Column(name = TAGS)
@ElasticSearch.IndexOnly
@SQLDatabase.AdditionalEntity(additionalTables = {ADDITIONAL_TAG_TABLE})
private List<String> tagsInString;
@Column(name = TAGS_RAW_DATA, storageOnly = true, length = Tag.TAG_LENGTH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
@Setter
@ScopeDeclaration(id = ALARM_RECOVERY, name = "AlarmRecovery")
@Stream(name = AlarmRecoveryRecord.INDEX_NAME, scopeId = DefaultScopeDefine.ALARM_RECOVERY, builder = AlarmRecoveryRecord.Builder.class, processor = RecordStreamProcessor.class)
@BanyanDB.TimestampColumn(AlarmRecoveryRecord.RECOVERY_TIME)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(AlarmRecoveryRecord.RECOVERY_TIME)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class AlarmRecoveryRecord extends Record {
public static final String INDEX_NAME = "alarm_recovery_record";
public static final String UUID = "uuid";
Expand All @@ -54,7 +54,7 @@ public StorageID id() {
@ElasticSearch.EnableDocValues
@Column(name = RECOVERY_TIME)
private long recoveryTime;
@BanyanDB.SeriesID(index = 0)
@BanyanDB.Stream.SeriesID(index = 0)
@Column(name = UUID)
private String uuid;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.apache.skywalking.oap.server.core.analysis.worker.RecordStreamProcessor;
import org.apache.skywalking.oap.server.core.analysis.worker.TopNStreamProcessor;
import org.apache.skywalking.oap.server.core.source.ScopeDeclaration;
import org.apache.skywalking.oap.server.core.storage.model.ModelInstaller;
import org.apache.skywalking.oap.server.core.storage.model.StorageManipulationOpt;
import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;

/**
Expand Down Expand Up @@ -61,28 +59,4 @@
* TopNStreamProcessor} and {@link NoneStreamProcessor} for more details.
*/
Class<? extends StreamProcessor> processor();

/**
* Opt-in to additive boot-time reshape of the backend resource for this stream class.
* <strong>BanyanDB only</strong> — JDBC and Elasticsearch are append-only on the data
* path and don't refuse additive column / mapping additions at boot, so they don't
* need (and don't read) this flag.
*
* <p>Default is {@code false} — boot follows the standard {@code schemaCreateIfAbsent}
* policy and records {@link StorageManipulationOpt.Outcome#SKIPPED_SHAPE_MISMATCH} on
* any shape divergence, leaving reconciliation to the operator (the only workflow that
* may change backend schema).
*
* <p>When set to {@code true}, the BanyanDB installer is allowed to apply
* <strong>purely additive</strong> changes (new tag, new field) during boot via
* {@code client.update}. Type changes, drops, kind flips, entity / interval /
* sharding-key changes are still refused with {@code SKIPPED_SHAPE_MISMATCH} and
* require a manual drop+recreate (identity-breaking edits are explicit operator
* actions, not boot side-effects).
*
* <p>Only the init / standalone OAP performs the reshape; non-init peers continue
* through the existing poll-and-wait loop in {@link ModelInstaller#whenCreating} so a
* single node drives DDL during a rolling restart.
*/
boolean allowBootReshape() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
@ScopeDeclaration(id = DefaultScopeDefine.AI_AGENT_SESSION_DATA, name = "AIAgentSessionData")
@Stream(name = AIAgentSessionDataRecord.INDEX_NAME, scopeId = DefaultScopeDefine.AI_AGENT_SESSION_DATA,
builder = AIAgentSessionDataRecord.Builder.class, processor = RecordStreamProcessor.class)
@BanyanDB.TimestampColumn(AIAgentSessionDataRecord.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS_AI_AGENT)
@BanyanDB.Stream.TimestampColumn(AIAgentSessionDataRecord.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS_AI_AGENT)
public class AIAgentSessionDataRecord extends Record {
public static final String INDEX_NAME = "ai_agent_session_data";
public static final String SERVICE_ID = "service_id";
Expand All @@ -71,13 +71,13 @@ public class AIAgentSessionDataRecord extends Record {
public static final int BODY_MAX_LENGTH = 16 * 1024 * 1024;

@Column(name = SERVICE_ID)
@BanyanDB.SeriesID(index = 0)
@BanyanDB.Stream.SeriesID(index = 0)
private String serviceId;
@Column(name = SERVICE_INSTANCE_ID, length = 512)
@BanyanDB.SeriesID(index = 1)
@BanyanDB.Stream.SeriesID(index = 1)
private String serviceInstanceId;
@Column(name = SESSION, length = 256)
@BanyanDB.SeriesID(index = 2)
@BanyanDB.Stream.SeriesID(index = 2)
private String session;
@ElasticSearch.EnableDocValues
@Column(name = SEQ)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
@SuperDataset
@ScopeDeclaration(id = DefaultScopeDefine.AI_AGENT_SESSION_FLOW, name = "AIAgentSessionFlow")
@Stream(name = AIAgentSessionFlowRecord.INDEX_NAME, scopeId = DefaultScopeDefine.AI_AGENT_SESSION_FLOW,
builder = AIAgentSessionFlowRecord.Builder.class, processor = RecordStreamProcessor.class, allowBootReshape = true)
@BanyanDB.TimestampColumn(AIAgentSessionFlowRecord.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS_AI_AGENT)
builder = AIAgentSessionFlowRecord.Builder.class, processor = RecordStreamProcessor.class)
@BanyanDB.Stream.AllowBootReshape
@BanyanDB.Stream.TimestampColumn(AIAgentSessionFlowRecord.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS_AI_AGENT)
public class AIAgentSessionFlowRecord extends Record {
public static final String INDEX_NAME = "ai_agent_session_flow";
public static final String SERVICE_ID = "service_id";
Expand Down Expand Up @@ -83,16 +84,16 @@ public class AIAgentSessionFlowRecord extends Record {
public static final int BODY_MAX_LENGTH = 16 * 1024 * 1024;

@Column(name = SERVICE_ID)
@BanyanDB.SeriesID(index = 0)
@BanyanDB.Stream.SeriesID(index = 0)
private String serviceId;
@Column(name = SERVICE_INSTANCE_ID, length = 512)
@BanyanDB.SeriesID(index = 1)
@BanyanDB.Stream.SeriesID(index = 1)
private String serviceInstanceId;
@Column(name = CONVERSATION, length = 256)
private String conversation;
/** Sortable, so the head of a chain is one read of the highest round rather than a page of rows. */
@ElasticSearch.EnableDocValues
@BanyanDB.EnableSort
@BanyanDB.Stream.EnableSort
@Column(name = ROUND)
private long round;
@Column(name = SESSION_FROM_TIME, storageOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNCacheReadCommand.INDEX_NAME, scopeId = DefaultScopeDefine.CACHE_SLOW_ACCESS, builder = TopNCacheReadCommand.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class TopNCacheReadCommand extends TopN {
public static final String INDEX_NAME = "top_n_cache_read_command";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNCacheWriteCommand.INDEX_NAME, scopeId = DefaultScopeDefine.CACHE_SLOW_ACCESS, builder = TopNCacheWriteCommand.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class TopNCacheWriteCommand extends TopN {
public static final String INDEX_NAME = "top_n_cache_write_command";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNDatabaseStatement.INDEX_NAME, scopeId = DefaultScopeDefine.DATABASE_SLOW_STATEMENT, builder = TopNDatabaseStatement.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class TopNDatabaseStatement extends TopN {
public static final String INDEX_NAME = "top_n_database_statement";
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
* Service Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNServiceDatabaseStatement.INDEX_NAME, scopeId = DefaultScopeDefine.SERVICE_DATABASE_SLOW_STATEMENT, builder = TopNServiceDatabaseStatement.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class TopNServiceDatabaseStatement extends TopN {

public static final String INDEX_NAME = "top_n_service_database_statement";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class EndpointTraffic extends Metrics {
@Column(name = NAME)
@ElasticSearch.Column(legacyName = "name")
@ElasticSearch.MatchQuery
@BanyanDB.MatchQuery(analyzer = BanyanDB.MatchQuery.AnalyzerType.URL)
@BanyanDB.IndexMode.MatchQuery(analyzer = BanyanDB.AnalyzerType.URL)
private String name = Const.EMPTY_STRING;
@Setter
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
@ScopeDeclaration(id = DefaultScopeDefine.GEN_AI_EVALUATION_RECORD, name = "GenAIEvaluationRecord")
@Stream(name = GenAIEvaluationRecord.INDEX_NAME, scopeId = DefaultScopeDefine.GEN_AI_EVALUATION_RECORD,
builder = GenAIEvaluationRecord.Builder.class, processor = RecordStreamProcessor.class)
@BanyanDB.TimestampColumn(GenAIEvaluationRecord.EVALUATION_TIME)
@BanyanDB.Group(streamGroup = BanyanDB.StreamGroup.RECORDS)
@BanyanDB.Stream.TimestampColumn(GenAIEvaluationRecord.EVALUATION_TIME)
@BanyanDB.Stream.Group(BanyanDB.StreamGroup.RECORDS)
public class GenAIEvaluationRecord extends Record {

public static final String INDEX_NAME = "gen_ai_evaluation_record";
Expand Down Expand Up @@ -84,7 +84,7 @@ public class GenAIEvaluationRecord extends Record {
private String uniqueId;

@Column(name = TRACE_ID, length = 150)
@BanyanDB.IndexRule(indexType = BanyanDB.IndexRule.IndexType.SKIPPING)
@BanyanDB.Stream.IndexRule(indexType = BanyanDB.Stream.IndexRule.IndexType.SKIPPING)
private String traceId;

@ElasticSearch.EnableDocValues
Expand All @@ -93,20 +93,20 @@ public class GenAIEvaluationRecord extends Record {

@ElasticSearch.EnableDocValues
@Column(name = PROVIDER_ID, length = 150)
@BanyanDB.SeriesID(index = 0)
@BanyanDB.Stream.SeriesID(index = 0)
private String providerId;

@ElasticSearch.EnableDocValues
@Column(name = MODEL_ID, length = 250)
@BanyanDB.SeriesID(index = 1)
@BanyanDB.Stream.SeriesID(index = 1)
private String modelId;

@ElasticSearch.EnableDocValues
@Column(name = OPERATION_NAME, length = 150)
private String operationName;

@ElasticSearch.EnableDocValues
@BanyanDB.EnableSort
@BanyanDB.Stream.EnableSort
@Column(name = EVAL_NUMBER_VALUE)
private Long evalNumberValue;

Expand All @@ -129,15 +129,15 @@ public class GenAIEvaluationRecord extends Record {

@Getter(AccessLevel.NONE)
@Column(name = VALUE_TYPE, length = 64)
@BanyanDB.IndexRule(indexType = BanyanDB.IndexRule.IndexType.SKIPPING)
@BanyanDB.Stream.IndexRule(indexType = BanyanDB.Stream.IndexRule.IndexType.SKIPPING)
private String valueType;

@Column(name = EVAL_STRING_VALUE, length = EVAL_STRING_VALUE_MAX_LENGTH, storageOnly = true)
private String evalStringValue;

@ElasticSearch.EnableDocValues
@Column(name = EVALUATION_LEVEL, length = 64)
@BanyanDB.IndexRule(indexType = BanyanDB.IndexRule.IndexType.SKIPPING)
@BanyanDB.Stream.IndexRule(indexType = BanyanDB.Stream.IndexRule.IndexType.SKIPPING)
private String evaluationLevel;

@Column(name = REASON, length = REASON_MAX_LENGTH, storageOnly = true)
Expand Down
Loading
Loading