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
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Release Notes.

## 0.7.0

### Features

### Bugs

- Fix the bug that topN query doesn't return when an error occurs.

## 0.6.0

### Features
Expand Down
6 changes: 5 additions & 1 deletion banyand/internal/storage/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ func (s *seriesIndex) searchPrimary(ctx context.Context, series []*pbv1.Series)
if err != nil {
return nil, err
}
return convertIndexSeriesToSeriesList(ss)
result, err := convertIndexSeriesToSeriesList(ss)
if err != nil {
return nil, errors.WithMessagef(err, "failed to convert index series to series list, matchers: %v, result:%v", seriesMatchers, ss)
}
return result, nil
}

var emptySeriesMatcher = index.SeriesMatcher{}
Expand Down
1 change: 1 addition & 0 deletions banyand/query/processor_topn.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (t *topNQueryProcessor) Rev(message bus.Message) (resp bus.Message) {
if err != nil {
ml.Error().Err(err).RawJSON("req", logger.Proto(request)).Msg("fail to close the topn plan")
resp = bus.NewMessage(bus.MessageID(now), common.NewError("fail to execute the topn plan for measure %s: %v", topNMetadata.GetName(), err))
return
}
defer func() {
if err = mIterator.Close(); err != nil {
Expand Down
18 changes: 18 additions & 0 deletions pkg/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ type Series struct {
ID common.SeriesID
}

func (s Series) String() string {
return fmt.Sprintf("%s:%d", s.EntityValues, s.ID)
}

// SeriesStore is an abstract of a series repository.
type SeriesStore interface {
Store
Expand All @@ -262,6 +266,20 @@ type SeriesMatcher struct {
Type SeriesMatcherType
}

// String returns a string representation of the series matcher.
func (s SeriesMatcher) String() string {
switch s.Type {
case SeriesMatcherTypeExact:
return fmt.Sprintf("exact:%s", s.Match)
case SeriesMatcherTypePrefix:
return fmt.Sprintf("prefix:%s", s.Match)
case SeriesMatcherTypeWildcard:
return fmt.Sprintf("wildcard:%s", s.Match)
default:
return fmt.Sprintf("unknown:%s", s.Match)
}
}

// GetSearcher returns a searcher associated with input index rule type.
type GetSearcher func(location databasev1.IndexRule_Type) (Searcher, error)

Expand Down
38 changes: 38 additions & 0 deletions test/stress/vm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

NAME := vm

CLI_ARGS :=

ifdef PROFILE
CLI_ARGS := $(CLI_ARGS) --profile $(PROFILE)
endif

cli_env := DOCKER_BUILDKIT=1 USER_ID=$(shell id -u) GROUP_ID=$(shell id -g)

.PHONY: clean
clean:
rm -rf /tmp/banyandb-stress-vm

up: clean
$(cli_env) docker compose -f docker-compose.yaml $(CLI_ARGS) up --build

down:
docker compose -f docker-compose.yaml down

95 changes: 95 additions & 0 deletions test/stress/vm/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: '3.8'
services:
change-vol-ownership:
image: ubuntu
user: "root"
group_add:
- '${GROUP_ID}'
volumes:
- /tmp/banyandb-stress-vm:/tmp/change-ownership
command: chown -R ${USER_ID}:${GROUP_ID} /tmp/change-ownership

banyandb:
user: "${USER_ID}:${GROUP_ID}"
extends:
file: ../../docker/base-compose.yml
service: banyandb
build:
dockerfile: ./docker/Dockerfile
context: ../../..
volumes:
- /tmp/banyandb-stress-vm:/tmp:rw,delgated
ports:
- 17913:17913
- 6060:6060
- 2121:2121
networks:
- skywalking
depends_on:
change-vol-ownership:
condition: service_completed_successfully

oap:
container_name: skywalking-server-bdb
image: ${OAP_IMAGE:-ghcr.io/apache/skywalking/oap:latest}
ports:
- "11800:11800"
- "12800:12800"
- "9099:9090"
- "3100:3100"
networks:
- skywalking
healthcheck:
test: [ "CMD-SHELL", "curl http://localhost:12800/internal/l7check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# restart: always
environment: &oap-env
TZ: Europe/Moscow
SW_HEALTH_CHECKER: default
SW_OTEL_RECEIVER: default
SW_OTEL_RECEIVER_ENABLED_OC_RULES: vm
SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES: vm
SW_TELEMETRY: prometheus
JAVA_OPTS: "-Xms2048m -Xmx2048m"
SW_STORAGE: banyandb
SW_STORAGE_BANYANDB_TARGETS: banyandb:17912
SW_CORE_RECORD_DATA_TTL: 14 # https://skywalking.apache.org/docs/main/next/en/setup/backend/ttl/
SW_CORE_METRICS_DATA_TTL: 14
SW_DCS_MAX_INBOUND_MESSAGE_SIZE: 5000000000
depends_on:
banyandb:
condition: service_healthy

ui:
image: ${UI_IMAGE:-ghcr.io/apache/skywalking/ui:latest}
container_name: skywalking-ui
ports:
- "1010:8080"
networks:
- skywalking
restart: always
environment:
<<: *oap-env
SW_OAP_ADDRESS: http://skywalking-server-bdb:12800
SW_ZIPKIN_ADDRESS: http://skywalking-server-bdb:9412

networks:
skywalking: