Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into shaoting-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoting-huang committed May 10, 2024
2 parents 7f54d6d + f7d2911 commit bf9c30b
Show file tree
Hide file tree
Showing 89 changed files with 3,045 additions and 2,661 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ generate-mockery-pkg:

generate-mockery: generate-mockery-types generate-mockery-kv generate-mockery-rootcoord generate-mockery-proxy generate-mockery-querycoord generate-mockery-querynode generate-mockery-datacoord generate-mockery-pkg

generate-yaml: milvus-tools
@echo "Updating milvus config yaml"
@$(PWD)/bin/tools/config gen-yaml && mv milvus.yaml configs/milvus.yaml

MMAP_MIGRATION_PATH = $(PWD)/cmd/tools/migration/mmap/tool
mmap-migration:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Contributions to Milvus are welcome from everyone. See [Guidelines for Contribut
### All contributors

<br><!-- Do not remove start of hero-bot -->
<img src="https://img.shields.io/badge/all--contributors-369-orange"><br>
<img src="https://img.shields.io/badge/all--contributors-370-orange"><br>
<a href="https://github.com/0xflotus"><img src="https://avatars.githubusercontent.com/u/26602940?v=4" width="30px" /></a>
<a href="https://github.com/ABNER-1"><img src="https://avatars.githubusercontent.com/u/24547351?v=4" width="30px" /></a>
<a href="https://github.com/Accagain2014"><img src="https://avatars.githubusercontent.com/u/9635216?v=4" width="30px" /></a>
Expand Down Expand Up @@ -416,6 +416,7 @@ Contributions to Milvus are welcome from everyone. See [Guidelines for Contribut
<a href="https://github.com/nexttonever"><img src="https://avatars.githubusercontent.com/u/31059690?v=4" width="30px" /></a>
<a href="https://github.com/neza2017"><img src="https://avatars.githubusercontent.com/u/34152706?v=4" width="30px" /></a>
<a href="https://github.com/nianliuu"><img src="https://avatars.githubusercontent.com/u/136299351?v=4" width="30px" /></a>
<a href="https://github.com/nish112022"><img src="https://avatars.githubusercontent.com/u/148342058?v=4" width="30px" /></a>
<a href="https://github.com/op-hunter"><img src="https://avatars.githubusercontent.com/u/5617677?v=4" width="30px" /></a>
<a href="https://github.com/ownbylichaobao"><img src="https://avatars.githubusercontent.com/u/37684963?v=4" width="30px" /></a>
<a href="https://github.com/panjf2000"><img src="https://avatars.githubusercontent.com/u/7496278?v=4" width="30px" /></a>
Expand Down
3 changes: 2 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Milvus [训练营](https://github.com/milvus-io/bootcamp)能够帮助你了解
### All contributors

<br><!-- Do not remove start of hero-bot -->
<img src="https://img.shields.io/badge/all--contributors-369-orange"><br>
<img src="https://img.shields.io/badge/all--contributors-370-orange"><br>
<a href="https://github.com/0xflotus"><img src="https://avatars.githubusercontent.com/u/26602940?v=4" width="30px" /></a>
<a href="https://github.com/ABNER-1"><img src="https://avatars.githubusercontent.com/u/24547351?v=4" width="30px" /></a>
<a href="https://github.com/Accagain2014"><img src="https://avatars.githubusercontent.com/u/9635216?v=4" width="30px" /></a>
Expand Down Expand Up @@ -401,6 +401,7 @@ Milvus [训练营](https://github.com/milvus-io/bootcamp)能够帮助你了解
<a href="https://github.com/nexttonever"><img src="https://avatars.githubusercontent.com/u/31059690?v=4" width="30px" /></a>
<a href="https://github.com/neza2017"><img src="https://avatars.githubusercontent.com/u/34152706?v=4" width="30px" /></a>
<a href="https://github.com/nianliuu"><img src="https://avatars.githubusercontent.com/u/136299351?v=4" width="30px" /></a>
<a href="https://github.com/nish112022"><img src="https://avatars.githubusercontent.com/u/148342058?v=4" width="30px" /></a>
<a href="https://github.com/op-hunter"><img src="https://avatars.githubusercontent.com/u/5617677?v=4" width="30px" /></a>
<a href="https://github.com/ownbylichaobao"><img src="https://avatars.githubusercontent.com/u/37684963?v=4" width="30px" /></a>
<a href="https://github.com/panjf2000"><img src="https://avatars.githubusercontent.com/u/7496278?v=4" width="30px" /></a>
Expand Down
26 changes: 26 additions & 0 deletions cmd/roles/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ import (
rocksmqimpl "github.com/milvus-io/milvus/internal/mq/mqimpl/rocksmq/server"
"github.com/milvus-io/milvus/internal/util/dependency"
kvfactory "github.com/milvus-io/milvus/internal/util/dependency/kv"
"github.com/milvus-io/milvus/internal/util/initcore"
internalmetrics "github.com/milvus-io/milvus/internal/util/metrics"
"github.com/milvus-io/milvus/pkg/config"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/metrics"
"github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper/nmq"
Expand Down Expand Up @@ -392,6 +394,30 @@ func (mr *MilvusRoles) Run() {

mr.setupLogger()
tracer.Init()
paramtable.Get().WatchKeyPrefix("trace", config.NewHandler("tracing handler", func(e *config.Event) {
params := paramtable.Get()

exp, err := tracer.CreateTracerExporter(params)
if err != nil {
log.Warn("Init tracer faield", zap.Error(err))
return
}

// close old provider
err = tracer.CloseTracerProvider(context.Background())
if err != nil {
log.Warn("Close old provider failed, stop reset", zap.Error(err))
return
}

tracer.SetTracerProvider(exp, params.TraceCfg.SampleFraction.GetAsFloat())
log.Info("Reset tracer finished", zap.String("Exporter", params.TraceCfg.Exporter.GetValue()))

if paramtable.GetRole() == typeutil.QueryNodeRole || paramtable.GetRole() == typeutil.StandaloneRole {
initcore.InitTraceConfig(params)
log.Info("Reset segcore tracer finished", zap.String("Exporter", params.TraceCfg.Exporter.GetValue()))
}
}))

paramtable.SetCreateTime(time.Now())
paramtable.SetUpdateTime(time.Now())
Expand Down
4 changes: 2 additions & 2 deletions configs/milvus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ quotaAndLimits:

trace:
# trace exporter type, default is stdout,
# optional values: ['stdout', 'jaeger', 'otlp']
exporter: stdout
# optional values: ['noop','stdout', 'jaeger', 'otlp']
exporter: noop
# fraction of traceID based sampler,
# optional values: [0, 1]
# Fractions >= 1 will always sample. Fractions < 0 are treated as zero.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/klauspost/compress v1.17.7
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.2
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240430035521-259ae1d10016
github.com/minio/minio-go/v7 v7.0.61
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81
github.com/prometheus/client_golang v1.14.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8=
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4=
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.2 h1:jgXBS8x8DTriF2pEI0RH/A+eJ8NI1f51iJcdiYEZOBg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.2/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240430035521-259ae1d10016 h1:8WV4maXLeGEyJCCYIc1DmZ18H+VFAjMrwXJg5iI2nX4=
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240430035521-259ae1d10016/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
github.com/milvus-io/milvus-storage/go v0.0.0-20231227072638-ebd0b8e56d70 h1:Z+sp64fmAOxAG7mU0dfVOXvAXlwRB0c8a96rIM5HevI=
github.com/milvus-io/milvus-storage/go v0.0.0-20231227072638-ebd0b8e56d70/go.mod h1:GPETMcTZq1gLY1WA6Na5kiNAKnq8SEMMiVKUZrM3sho=
github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A=
Expand Down
11 changes: 11 additions & 0 deletions internal/core/src/common/init_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,14 @@ InitTrace(CTraceConfig* config) {
},
traceConfig);
}

void
SetTrace(CTraceConfig* config) {
auto traceConfig = milvus::tracer::TraceConfig{config->exporter,
config->sampleFraction,
config->jaegerURL,
config->otlpEndpoint,
config->oltpSecure,
config->nodeID};
milvus::tracer::initTelemetry(traceConfig);
}
3 changes: 3 additions & 0 deletions internal/core/src/common/init_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ InitCpuNum(const int);
void
InitTrace(CTraceConfig* config);

void
SetTrace(CTraceConfig* config);

#ifdef __cplusplus
};
#endif
2 changes: 1 addition & 1 deletion internal/core/thirdparty/knowhere/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#-------------------------------------------------------------------------------

# Update KNOWHERE_VERSION for the first occurrence
set( KNOWHERE_VERSION v2.3.1 )
set( KNOWHERE_VERSION f29da89 )
set( GIT_REPOSITORY "https://github.com/zilliztech/knowhere.git")
message(STATUS "Knowhere repo: ${GIT_REPOSITORY}")
message(STATUS "Knowhere version: ${KNOWHERE_VERSION}")
Expand Down
98 changes: 98 additions & 0 deletions internal/core/thirdparty/tantivy/tantivy-binding/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/core/thirdparty/tantivy/tantivy-binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ futures = "0.3.21"
libc = "0.2"
scopeguard = "1.2"
zstd-sys = "=2.0.9"
env_logger = "0.11.3"
log = "0.4.21"

[build-dependencies]
cbindgen = "0.26.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use tantivy::query::{Query, RangeQuery, RegexQuery, TermQuery};
use tantivy::schema::{Field, IndexRecordOption};
use tantivy::{Index, IndexReader, ReloadPolicy, Term};

use crate::log::init_log;
use crate::util::make_bounds;
use crate::vec_collector::VecCollector;

Expand All @@ -18,6 +19,8 @@ pub struct IndexReaderWrapper {

impl IndexReaderWrapper {
pub fn new(index: &Index, field_name: &String, field: Field) -> IndexReaderWrapper {
init_log();

let reader = index
.reader_builder()
.reload_policy(ReloadPolicy::Manual)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ pub extern "C" fn tantivy_prefix_query_keyword(
}

#[no_mangle]
pub extern "C" fn tantivy_regex_query(
ptr: *mut c_void,
pattern: *const c_char,
) -> RustArray {
pub extern "C" fn tantivy_regex_query(ptr: *mut c_void, pattern: *const c_char) -> RustArray {
let real = ptr as *mut IndexReaderWrapper;
unsafe {
let c_str = CStr::from_ptr(pattern);
Expand Down
Loading

0 comments on commit bf9c30b

Please sign in to comment.