Skip to content

Commit

Permalink
Update to version v3.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MadSchemas committed Mar 7, 2024
1 parent 7f65a8c commit 47b03e6
Show file tree
Hide file tree
Showing 135 changed files with 8,435 additions and 2,102 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ jobs:
- name: Build Reindexer
run: |
mkdir build && cd build
cmake -G "${{matrix.compiler}}" ..
cmake -G "${{matrix.compiler}}" .. -Ax64
cmake --build . --config Release
cmake --build . --config Release --target face
cmake --build . --config Release --target swagger
cpack
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-latest
path: build/*.exe
if-no-files-found: error

build-windows-2019:
runs-on: windows-2019
Expand All @@ -35,6 +42,7 @@ jobs:
cmake --build . --config Release
cmake --build . --config Release --target face
cmake --build . --config Release --target swagger
cpack
build:
strategy:
Expand Down Expand Up @@ -226,3 +234,4 @@ jobs:
run: |
cd pyreindexer
../.github/workflows/test.sh
7 changes: 4 additions & 3 deletions bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
modeDelete = bindings.ModeDelete
)

func (db *reindexerImpl) modifyItem(ctx context.Context, namespace string, ns *reindexerNamespace, item interface{}, json []byte, mode int, precepts ...string) (count int, err error) {
func (db *reindexerImpl) modifyItem(ctx context.Context, namespace string, ns *reindexerNamespace, item interface{}, mode int, precepts ...string) (count int, err error) {

if ns == nil {
ns, err = db.getNS(namespace)
Expand All @@ -38,7 +38,7 @@ func (db *reindexerImpl) modifyItem(ctx context.Context, namespace string, ns *r
format := 0
stateToken := 0

if format, stateToken, err = packItem(ns, item, json, ser); err != nil {
if format, stateToken, err = packItem(ns, item, nil, ser); err != nil {
return
}

Expand Down Expand Up @@ -82,7 +82,6 @@ func (db *reindexerImpl) modifyItem(ctx context.Context, namespace string, ns *r
}

func packItem(ns *reindexerNamespace, item interface{}, json []byte, ser *cjson.Serializer) (format int, stateToken int, err error) {

if item != nil {
json, _ = item.([]byte)
}
Expand Down Expand Up @@ -134,6 +133,7 @@ func unpackItem(bin bindings.RawBinding, ns *nsArrayEntry, params *rawResultItem
} else {
item = reflect.New(ns.rtype).Interface()
dec := ns.localCjsonState.NewDecoder(item, bin)
defer dec.Finalize()
if params.cptr != 0 {
err = dec.DecodeCPtr(params.cptr, item)
} else if params.data != nil {
Expand All @@ -160,6 +160,7 @@ func unpackItem(bin bindings.RawBinding, ns *nsArrayEntry, params *rawResultItem
item = reflect.New(ns.rtype).Interface()
}
dec := ns.localCjsonState.NewDecoder(item, bin)
defer dec.Finalize()
if params.cptr != 0 {
err = dec.DecodeCPtr(params.cptr, item)
} else if params.data != nil {
Expand Down
2 changes: 1 addition & 1 deletion bindings/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bindings

const CInt32Max = int(^uint32(0) >> 1)

const ReindexerVersion = "v3.22.1"
const ReindexerVersion = "v3.23.0"

// public go consts from type_consts.h and reindexer_ctypes.h
const (
Expand Down
34 changes: 34 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# Version 3.23.0 (07.03.2024)

## Core
- [fea] Improved queries condition injection injection on the both directions: joined-to-main and main-to-joined
- [fea] Improved heuristic for the joins preselect/condition injection. If query has some conditions with high selectivity, scheduler will try to avoid high cost preselect/injections attempts
- [fea] Added logic for the intersecting conditions merge on the query preprocessing stage
- [fea] Added clock wrapper to force [vDSO](https://ru.manpages.org/vdso/7) for the `clock_gettime`-calls. This gives up to 20% overall performance on the some operation systems, which using libstdc++ without vDSO (for example, on Centos7)
- [fea] Updated bundled libbactrace to support DWARF-v5 debug info format
- [fix] Fixed indexes/count cache drop on the indexes config update

## Go connector
- [fea] Optimized handling of the unknow fields in the Go binding (in cases, when some field exists in the database, but not in the go-struct)

## Deploy
- [fea] Updated Redos build/deploy image to v3.3.4

## Face
- [fea] Added Prettify feature to the SQL editor
- [fea] Made yarn upgrade
- [fea] Added Cache settings to the NS config
- [fea] Made the new UI component for the pagination
- [fea] Added tooltips with the UTC dates for the timestamp dates in the Grid view of the Namespace
- [fea] Added redirect to the created NS
- [fea] Added new settings to the Full text config
- [fea] Added Stop Words list to the Full text index
- [fea] Improved layout of the Stop words and Synonyms lists
- [fix] Fixed columns enabling/disabling in the Grid views
- [fix] Fixed issue related to the previously NS current columns displaying for the NS
- [fix] Fixed issue related to the empty config opening
- [fix] Fixed issue related to the pagination on the Query result page
- [fix] Removed eslint popup
- [fix] Fixed "see & edit" link on the Queries Perfstats page
- [fix] Fixed tooltips view

# Version 3.22.1 (12.02.2024)
## Core
- [fix] Fixed `COUNT()` for fulltext queries, when `preselect_before_ft` is enabled in the index config
Expand Down
18 changes: 9 additions & 9 deletions cjson/ctag.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ const (
TAG_UUID = 8
)

func (c ctag) Name() int {
return int(c>>typeBits) & nameMask
func (c ctag) Name() int16 {
return int16(c>>typeBits) & nameMask
}

func (c ctag) Type() int {
return (int(c) & typeMask) | (((int(c) >> type2Offset) & typeMask) << typeBits)
func (c ctag) Type() int16 {
return int16(int(c)&typeMask) | int16(((int(c)>>type2Offset)&typeMask)<<typeBits)
}

func (c ctag) Field() int {
return ((int(c) >> (typeBits + nameBits)) & fieldMask) - 1
func (c ctag) Field() int16 {
return int16((int(c)>>(typeBits+nameBits))&fieldMask) - 1
}

func (c ctag) Dump() string {
return fmt.Sprintf("(%s n:%d f:%d)", tagTypeName(c.Type()), c.Name(), c.Field())
}

func tagTypeName(tagType int) string {
func tagTypeName(tagType int16) string {
switch tagType {
case TAG_VARINT:
return "<varint>"
Expand Down Expand Up @@ -83,8 +83,8 @@ func (t carraytag) Count() int {
return int(t) & countMask
}

func (t carraytag) Tag() int {
return int(t) >> countBits
func (t carraytag) Tag() int16 {
return int16(int(t) >> countBits)
}

func mkcarraytag(count int, tag int) carraytag {
Expand Down
44 changes: 29 additions & 15 deletions cjson/ctagscache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,48 @@ type ctagsCacheEntry struct {
subCache ctagsCache
}

type ctagsCache []ctagsCacheEntry
type missingTagsCache map[string]struct{}

type ctagsCache struct {
entries []ctagsCacheEntry
missing missingTagsCache
}

type structCache map[reflect.Type]*ctagsCache

func (tc *ctagsCache) Reset() {
*tc = (*tc)[:0]
tc.entries = tc.entries[:0]
tc.missing = make(missingTagsCache)
}

func (tc *ctagsCache) Lookup(cachePath []int, canAdd bool) *[]int {
func (tc *ctagsCache) Find(cachePath []int16) *[]int {
ctag := cachePath[0]
if len(*tc) <= ctag {
if !canAdd {
return nil
}
if cap(*tc) <= ctag {
nc := make([]ctagsCacheEntry, len(*tc), ctag+1)
copy(nc, *tc)
*tc = nc
if len(tc.entries) <= int(ctag) {
return nil
}
if len(cachePath) == 1 {
return &tc.entries[ctag].structIdx
}
return tc.entries[ctag].subCache.Find(cachePath[1:])
}

func (tc *ctagsCache) FindOrAdd(cachePath []int16) *[]int {
ctag := int(cachePath[0])
if len(tc.entries) <= ctag {
if cap(tc.entries) <= ctag {
nc := make([]ctagsCacheEntry, len(tc.entries), ctag+1)
copy(nc, tc.entries)
tc.entries = nc
}
for n := len(*tc); n < ctag+1; n++ {
*tc = append(*tc, ctagsCacheEntry{})
for n := len(tc.entries); n < ctag+1; n++ {
tc.entries = append(tc.entries, ctagsCacheEntry{})
}
}
if len(cachePath) == 1 {
return &(*tc)[ctag].structIdx
return &tc.entries[ctag].structIdx
}

return (*tc)[ctag].subCache.Lookup(cachePath[1:], canAdd)
return tc.entries[ctag].subCache.FindOrAdd(cachePath[1:])
}

type ctagsWCacheEntry struct {
Expand Down
4 changes: 2 additions & 2 deletions cjson/ctagsmatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ func (tm *tagsMatcher) WriteUpdated(ser *Serializer) {
}
}

func (tm *tagsMatcher) tag2name(tag int) string {
func (tm *tagsMatcher) tag2name(tag int16) string {
tag = tag & ((1 << 12) - 1)
if tag == 0 {
return ""
}
if tag-1 >= len(tm.Tags) {
if int(tag)-1 >= len(tm.Tags) {
panic(fmt.Errorf("Internal error - unknown tag %d\nKnown tags: %v", tag, tm.Names))
}

Expand Down
Loading

0 comments on commit 47b03e6

Please sign in to comment.