Skip to content

Commit edd3a26

Browse files
authored
BanyanDB: fix when setting @BanyanDB.TimestampColumn, the column should not be indexed. (#13525)
1 parent 2ec8e18 commit edd3a26

File tree

13 files changed

+25
-19
lines changed

13 files changed

+25
-19
lines changed

docs/en/api/query-protocol.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ extend type Query {
169169
queryBasicTraces(condition: TraceQueryCondition, debug: Boolean): TraceBrief
170170
queryBasicTracesByName(condition: TraceQueryConditionByName, debug: Boolean): TraceBrief
171171
# Read the specific trace ID with given trace ID
172-
queryTrace(traceId: ID!, debug: Boolean): Trace
173-
# Only for BanyanDB, can be used to query the trace in the cold stage.
174-
queryTraceFromColdStage(traceId: ID!, duration: Duration!, debug: Boolean): Trace
172+
# duration is optional, and only for BanyanDB. If not provided, means search in the last 1 day.
173+
queryTrace(traceId: ID!, duration: Duration, debug: Boolean): Trace
175174
# Read the list of searchable keys
176175
queryTraceTagAutocompleteKeys(duration: Duration!):[String!]
177176
# Search the available value options of the given key.
@@ -181,6 +180,17 @@ extend type Query {
181180

182181
Trace query fetches trace segment lists and spans of given trace IDs.
183182

183+
### Trace-v2
184+
```graphql
185+
extend type Query {
186+
queryTraces(condition: TraceQueryCondition, debug: Boolean): TraceList
187+
# Feature detection endpoint: returns true if the backend supports the Query Traces V2 API.
188+
# Returns false if the backend does not support Query Traces V2.
189+
# This field is intended to assist clients in migrating to the new API.
190+
hasQueryTracesV2Support: Boolean!
191+
}
192+
```
193+
184194
### Alarm
185195
```graphql
186196
extend type Query {

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
* Fix potential NPE in the `AlarmStatusQueryHandler`.
104104
* Aggregate TopN Slow SQL by service dimension.
105105
* BanyanDB: support add group prefix (namespace) for BanyanDB groups.
106+
* BanyanDB: fix when setting `@BanyanDB.TimestampColumn`, the column should not be indexed.
106107

107108
#### UI
108109

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public class SegmentRecord extends Record implements BanyanDBTrace {
9898
@Getter
9999
@ElasticSearch.EnableDocValues
100100
@Column(name = START_TIME)
101-
@BanyanDB.NoIndexing
102101
private long startTime;
103102
@Setter
104103
@Getter

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/spanattach/SWSpanAttachedEventRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public class SWSpanAttachedEventRecord extends Record implements BanyanDBTrace,
8787
@Getter
8888
@ElasticSearch.EnableDocValues
8989
@Column(name = TIMESTAMP)
90-
@BanyanDB.NoIndexing
9190
private long timestamp;
9291

9392
@Override

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/spanattach/SpanAttachedEventRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public class SpanAttachedEventRecord extends Record implements BanyanDBTrace, Ba
8787
@Getter
8888
@ElasticSearch.EnableDocValues
8989
@Column(name = TIMESTAMP)
90-
@BanyanDB.NoIndexing
9190
private long timestamp;
9291

9392
@Override

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/ebpf/storage/EBPFProfilingTaskRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public class EBPFProfilingTaskRecord extends NoneStream {
8383
private int targetType = EBPFProfilingTargetType.UNKNOWN.value();
8484
@ElasticSearch.EnableDocValues
8585
@Column(name = CREATE_TIME)
86-
@BanyanDB.NoIndexing
8786
private long createTime;
8887
@Column(name = LAST_UPDATE_TIME)
8988
private long lastUpdateTime;

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/ProfileTaskRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public StorageID id() {
7070
private String taskId;
7171
@ElasticSearch.EnableDocValues
7272
@Column(name = START_TIME)
73-
@BanyanDB.NoIndexing
7473
private long startTime;
7574
@Column(name = DURATION)
7675
private int duration;

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/ProfileThreadSnapshotRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public class ProfileThreadSnapshotRecord extends Record {
6363
private String segmentId;
6464
@ElasticSearch.EnableDocValues
6565
@Column(name = DUMP_TIME)
66-
@BanyanDB.NoIndexing
6766
private long dumpTime;
6867
@ElasticSearch.EnableDocValues
6968
@Column(name = SEQUENCE)

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/BanyanDB.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
/**
107107
* Force disabling indexing declare through {@link Column}.
108108
* In BanyanDB, some additional conditions could be done in server memory, no indexing required in this case.
109-
*
109+
* In the Trace model, no indexing means no tag would be created in BanyanDB.
110+
* In the Stream model, no indexing means no index rule would be created in BanyanDB.
110111
* @since 9.1.0
111112
*/
112113
@Target({ElementType.FIELD})
@@ -148,9 +149,9 @@ enum IndexType {
148149
}
149150

150151
/**
151-
* timestampColumn is to identify which column in {@link Record} is providing the timestamp(millisecond) for
152-
* BanyanDB.
152+
* timestampColumn is to identify which column in {@link Record} is providing the timestamp(millisecond) for BanyanDB.
153153
* BanyanDB stream requires a timestamp in milliseconds.
154+
* Notice, the timestamp column would not create an index rule in BanyanDB.
154155
*
155156
* @since 9.3.0
156157
*/

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelColumn.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public ModelColumn(ColumnName columnName,
112112
}
113113

114114
/**
115+
* Notice, for BanyanDB, should use {@link BanyanDBExtension#shouldIndex()} instead.
115116
* @return true means this column should be indexed, as it would be a query condition.
116117
*/
117118
public boolean shouldIndex() {

0 commit comments

Comments
 (0)