[MOD-8034] expose indexing failures to INFO modules#5139
Conversation
move dialects stats to global_stats
The counter is update at runtime, once the error occured. It reflects the total number of indexing errors in all living indices. The counter should be decreased whenever an index is dropped. introduce FieldSpec_AddError that adds an error to a specific field. it also updates the global field error counter. We expose the global counter value in INFO modules, along with each field type stats. the name of the fields count for each type was changed from "Field_type_name" to "Total"
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5139 +/- ##
=======================================
Coverage 86.35% 86.35%
=======================================
Files 190 190
Lines 34642 34668 +26
=======================================
+ Hits 29915 29938 +23
- Misses 4727 4730 +3 ☔ View full report in Codecov by Sentry. |
wait for bg index after FT.ALTER to avoid flakyness
| FieldsGlobalStats_UpdateStats(spec->fields + i, -1); | ||
| FieldSpec *field = spec->fields + i; | ||
| FieldsGlobalStats_UpdateStats(field, -1); | ||
| FieldsGlobalStats_UpdateIndexError(field->types, -FieldSpec_GetIndexErrorCount(field)); |
There was a problem hiding this comment.
Why is that actually? Total number of errors did not decrease
There was a problem hiding this comment.
Nevermind. I'm convinced - let's go with this approach :)
src/redisearch_api.c
Outdated
| if (info.indexing_errors.max_indexing_failures < index_error_count) { | ||
| info.indexing_errors.max_indexing_failures = index_error_count; | ||
| } |
There was a problem hiding this comment.
Shouldn't we initialize max_indexing_failures before the loop?
There was a problem hiding this comment.
maybe you're right because indexing_errors is a nested struct
| env.assertEqual(info['num_docs'], 0) | ||
| env.assertEqual(info['field statistics'][0], expected_failed_field_stats) | ||
| env.assertEqual(info['field statistics'][1], expected_no_error_field_stats) |
There was a problem hiding this comment.
I understand why that is correct, but looking at it now, it might be misleading... Perhaps it would be better if we at least increase the indexing failures on each field in the spec anyway once we encounter an error in one of the fields, so it won't look like a partial indexing was made. WDYT?
There was a problem hiding this comment.
I think it makes the per-field indexing error counter redundant, as a we would like to identify field-types with higher errors amount
There was a problem hiding this comment.
i don't see a reason why it may look like partial indexing since the error is counted in the index level as well.
There was a problem hiding this comment.
I see what you mean. How about trying to index each field instead of failing fast and setting the error counter for the bad fields? It would increase latency but in error code path we should care less. How big of a change is that?
remove IndexingErrorsStats and put the fields in TotalSpecsInfo
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-5139-to-2.10 origin/2.10
cd .worktree/backport-5139-to-2.10
git switch --create backport-5139-to-2.10
git cherry-pick -x 9ef9bd96d0ec8c1cdeb5dc92f38da4d83e7ea9f7 |
* move fieldsStats from RSGlobalConfig to RSGlobalStats move dialects stats to global_stats * Introduce a global counter for indexing failures for each field type. The counter is update at runtime, once the error occured. It reflects the total number of indexing errors in all living indices. The counter should be decreased whenever an index is dropped. introduce FieldSpec_AddError that adds an error to a specific field. it also updates the global field error counter. We expose the global counter value in INFO modules, along with each field type stats. the name of the fields count for each type was changed from "Field_type_name" to "Total" * fix test * skip test_redis_info_errors in cluster wait for bg index after FT.ALTER to avoid flakyness * revert change in INFO MODULES field count name * fix test format * fix test flakyness remove IndexingErrorsStats and put the fields in TotalSpecsInfo (cherry picked from commit 9ef9bd9)
|
Successfully created backport PR for |
* move fieldsStats from RSGlobalConfig to RSGlobalStats move dialects stats to global_stats * Introduce a global counter for indexing failures for each field type. The counter is update at runtime, once the error occured. It reflects the total number of indexing errors in all living indices. The counter should be decreased whenever an index is dropped. introduce FieldSpec_AddError that adds an error to a specific field. it also updates the global field error counter. We expose the global counter value in INFO modules, along with each field type stats. the name of the fields count for each type was changed from "Field_type_name" to "Total" * fix test * skip test_redis_info_errors in cluster wait for bg index after FT.ALTER to avoid flakyness * revert change in INFO MODULES field count name * fix test format * fix test flakyness remove IndexingErrorsStats and put the fields in TotalSpecsInfo (cherry picked from commit 9ef9bd9)
[MOD-8034] expose indexing failures to INFO modules (#5139) * move fieldsStats from RSGlobalConfig to RSGlobalStats move dialects stats to global_stats * Introduce a global counter for indexing failures for each field type. The counter is update at runtime, once the error occured. It reflects the total number of indexing errors in all living indices. The counter should be decreased whenever an index is dropped. introduce FieldSpec_AddError that adds an error to a specific field. it also updates the global field error counter. We expose the global counter value in INFO modules, along with each field type stats. the name of the fields count for each type was changed from "Field_type_name" to "Total" * fix test * skip test_redis_info_errors in cluster wait for bg index after FT.ALTER to avoid flakyness * revert change in INFO MODULES field count name * fix test format * fix test flakyness remove IndexingErrorsStats and put the fields in TotalSpecsInfo (cherry picked from commit 9ef9bd9) Co-authored-by: meiravgri <[email protected]>
* [MOD-8034] expose indexing failures to INFO modules (#5139) * move fieldsStats from RSGlobalConfig to RSGlobalStats move dialects stats to global_stats * Introduce a global counter for indexing failures for each field type. The counter is update at runtime, once the error occured. It reflects the total number of indexing errors in all living indices. The counter should be decreased whenever an index is dropped. introduce FieldSpec_AddError that adds an error to a specific field. it also updates the global field error counter. We expose the global counter value in INFO modules, along with each field type stats. the name of the fields count for each type was changed from "Field_type_name" to "Total" * fix test * skip test_redis_info_errors in cluster wait for bg index after FT.ALTER to avoid flakyness * revert change in INFO MODULES field count name * fix test format * fix test flakyness remove IndexingErrorsStats and put the fields in TotalSpecsInfo (cherry picked from commit 9ef9bd9) * add geoshape to test_info_modules.py
This PR exposes indexing errors counter to
INFO MODULESsearch_errors_*sectionadded fields:
errors_indexing_failures- reflects the total number of indexing errors in all living indices. One document may cause failure in multiple indices.errors_indexing_failures_maxsearc_field_FieldTypeFieldSpec_AddErrorthat adds an error to a specific field object, and also updates the global per-field-type error counter.The global counter is updated at runtime, once the error occurred. (as opposed to saving a counter per index and aggregating it per
INFOcall)The counter should be decreased whenever an index is dropped.
We expose the global counter value in INFO modules, along with each field type stats.
Mark if applicable