Skip to content

Commit

Permalink
fix createindex again hang up
Browse files Browse the repository at this point in the history
Signed-off-by: Xianhui.Lin <[email protected]>

fix unitest

Signed-off-by: Xianhui.Lin <[email protected]>

fix createindex hang

Signed-off-by: Xianhui.Lin <[email protected]>

fix triggerstatstask go ut

Signed-off-by: Xianhui.Lin <[email protected]>
  • Loading branch information
JsDove committed Dec 30, 2024
1 parent bbee182 commit 04b2f80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/core/src/index/JsonKeyInvertedIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ JsonKeyInvertedIndex::TravelJson(const char* json,

void
JsonKeyInvertedIndex::AddJson(const char* json, int64_t offset) {
if (json == nullptr) {
return;
}
jsmn_parser parser;
jsmntok_t* tokens = (jsmntok_t*)malloc(16 * sizeof(jsmntok_t));
if (!tokens) {
Expand Down Expand Up @@ -225,6 +222,9 @@ JsonKeyInvertedIndex::BuildWithFieldData(
for (int i = 0; i < n; i++) {
if (!data->is_valid(i)) {
null_offset.push_back(i);
std::string empty = "";
wrapper_->add_multi_data(&empty, 0, offset++);
return;

Check warning on line 227 in internal/core/src/index/JsonKeyInvertedIndex.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/index/JsonKeyInvertedIndex.cpp#L220-L227

Added lines #L220 - L227 were not covered by tests
}
AddJson(static_cast<const milvus::Json*>(data->RawValue(i))
->data()

Check warning on line 230 in internal/core/src/index/JsonKeyInvertedIndex.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/index/JsonKeyInvertedIndex.cpp#L229-L230

Added lines #L229 - L230 were not covered by tests
Expand Down
3 changes: 2 additions & 1 deletion internal/datacoord/job_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ func needDoTextIndex(segment *SegmentInfo, fieldIDs []UniqueID) bool {
}

func needDoJsonKeyIndex(segment *SegmentInfo, fieldIDs []UniqueID) bool {
if !isFlush(segment) {
if !(isFlush(segment) && segment.GetLevel() != datapb.SegmentLevel_L0 &&
segment.GetIsSorted()) {
return false
}
for _, fieldID := range fieldIDs {
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/job_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ func (s *jobManagerSuite) TestJobManager_triggerStatsTaskLoop() {

jm.loopWg.Wait()

s.Equal(4, len(jm.scheduler.tasks))
s.Equal(3, len(jm.scheduler.tasks))
}

0 comments on commit 04b2f80

Please sign in to comment.