Skip to content

Commit

Permalink
MB-59846, MB-59616, MB-61009: Cluster version tracking for features
Browse files Browse the repository at this point in the history
+ Cluster version tracking for features:
    - xattrs
    - vector_base64
    - dims:4096
+ This change separates out feature strings for xattrs and vector_base64
  because xattrs is not restricted to vectors alone.
+ vector_base64 is combined with dims:4096 which are meant to go out
  together in v2 (7.6.2).
+ Also requires: blevesearch/bleve#2015

Change-Id: I44daa225b5c397e9f8cae26ce3fcb36cab9b26d6
Reviewed-on: https://review.couchbase.org/c/cbft/+/208927
Well-Formed: Build Bot <[email protected]>
Well-Formed: Restriction Checker
Reviewed-by: Likith B <[email protected]>
Tested-by: Abhi Dangeti <[email protected]>
  • Loading branch information
abhinavdangeti committed Apr 25, 2024
1 parent faf95c9 commit 168fac6
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 150 deletions.
2 changes: 1 addition & 1 deletion cmd/cbft/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func mainStart(cfg cbgt.Cfg, uuid string, tags []string, container string,
"," + cbft.FeatureFileTransferRebalance +
"," + cbft.FeatureGeoSpatial +
cbft.FeatureVectorSearchSupport() +
"," + cbft.FeatureXattrsAndBase64
"," + cbft.FeatureXattrs

extrasMap["version-cbft.app"] = version
extrasMap["version-cbft.lib"] = cbft.VERSION
Expand Down
6 changes: 6 additions & 0 deletions knn_nosup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ import (
"github.com/blevesearch/bleve/v2"
)

const featuresVectorBase64Dims4096 = ""

func FeatureVectorSearchSupport() string {
return ""
}

func featureFlagForDims(int) string {
return ""
}

func interpretKNNForRequest(knn, knnOperator json.RawMessage, r *bleve.SearchRequest) (
*bleve.SearchRequest, error) {
// Not supported
Expand Down
20 changes: 19 additions & 1 deletion knn_sup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,26 @@ import (
"github.com/blevesearch/bleve/v2"
)

// v2: 7.6.2
const featuresVectorBase64Dims4096 = "vector_base64_dims:4096"

func FeatureVectorSearchSupport() string {
return "," + FeatureVectorSearch
return "," + featureVectorSearch +
"," + featuresVectorBase64Dims4096
}

// method will return appropriate flag to check cluster wide
// if & when dims' ceiling is raised in the future
func featureFlagForDims(dims int) string {
if dims <= 2048 {
return ""
}

if dims <= 4096 {
return featuresVectorBase64Dims4096
}

return ""
}

func interpretKNNForRequest(knn, knnOperator json.RawMessage, r *bleve.SearchRequest) (
Expand Down
Loading

0 comments on commit 168fac6

Please sign in to comment.