Repository navigation
fix(indexing): record a rejected document of a data store crawl as its own failure URL - #4037
Merged
Merged
Conversation
A data store crawl records a failed bulk request as a failure URL of the row that filled the batch, which can be another document, even of another data configuration. The exception message now starts with the URLs of the rejected documents (the first ten, without userinfo).
All data configurations of a job share one document cache. The row that fills it sends the bulk request, so a data store recorded a rejection for that row, possibly under another data configuration. The callback of the data store crawl now stores one failure URL for each rejected document, with its URL and data configuration, and the failure URL service stores nothing else for that exception. The exception is still thrown to the data store, so its error handling is unchanged.
… document Problem The warning about a rejected document, the message of the exception and the failure URL still repeated values of the document. The search engine quotes them in many places: the causes of a date, number, IP address, boolean, geo or range error, the first bytes of a term that is too long, and the reason of a rejection made by an ingest pipeline. Removing known phrases cannot cover them. Change - The reason is shown only for mapper_parsing_exception, strict_dynamic_mapping_exception, cluster_block_exception and a term that is too long, without the preview of the value or of the term. Any other reason is shown as <omitted>. - Of the root cause only the error type is shown. - The message of the exception is built from these descriptions instead of BulkResponse#buildFailureMessage, which repeats every cause. - Note on BulkRejectedException#isRecorded that fess-ds-git looks it up by name. Tests New tests in IndexingHelperTest use error responses of OpenSearch 3.10.1 and check the warning, the exception message and the description kept for the failure URL. The indexing, data store callback, failure URL, data index and search engine client tests pass (403). With the previous code, 18 of the 52 tests of IndexingHelperTest and IndexUpdateCallbackImplRejectionTest fail, 14 because a value is found. Checked on a running Fess with OpenSearch 3.10.1 and a CSV crawl with a rejected date value, a term that is too long and a rejected number: none of them is in the failure URLs or the logs of Fess. With the previous code the date value and the bytes of the term are. Web and file crawls were not run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the search engine rejects a document in a bulk request during a data store crawl, the failure URL does not point at it. All data configurations of a job share one callback and its document cache, and the row that happens to fill the cache sends the request. The data store catches the exception for that row and records it, possibly under another data configuration. The recorded error only carries document ids. A rejection in the last request, sent by the commit at the end of the crawl, is recorded for the data configuration only. This also happens with 15.9.0.
The warning about a rejected document and the exception, which is logged and stored in failure URLs, also repeat values of the document. Known phrases are removed, but the search engine quotes values in many more places: in the causes of a date, number, IP address, boolean, geo or range error, as the first bytes of a term that is too long, and in the reason of a rejection made by an ingest pipeline. A value that is a URL with userinfo is repeated with its password.
Change
Failure URLs:
SearchEngineClientExceptionthrown byIndexingHelper#sendDocumentsfor rejected documents starts withRejected documents: <urls>. Userinfo is removed from the URLs, and only the first ten are listed, followed by the number of the others. It is now a subclass,BulkRejectedException, which also carries the URL, the configuration ID and the description of the rejection of every rejected document.IndexUpdateCallbackImplstores one failure URL for each rejected document, with its own URL, data configuration and description. This covers both the requests sent while rows are stored and the commit.FailureUrlServicestores nothing else for an exception that is, or is caused by, a rejection recorded this way. The data store therefore no longer adds a record for the row that filled the cache, and a failed commit or an aborted crawl no longer adds a record for the data configuration.Description of a rejection, used in the warning, the exception message and the failure URL:
mapper_parsing_exception,strict_dynamic_mapping_exception,cluster_block_exceptionand a term that is too long. The preview of the field value, or of the first bytes of the term, is cut off with everything after it. Any other reason is shown as<omitted>.BulkResponse#buildFailureMessage, which repeats every cause. It lists the index, the ID and the description of every rejected document. The protected methodIndexingHelper#withoutFieldValues, which 15.9.0 has, is removed.This loses some detail. For example, a vector of the wrong dimension is now reported as a mapping error of its field caused by an
illegal_argument_exception, without the two dimensions, and a rejection of another type, such as an exceeded field limit or a failing ingest pipeline (including the message of afailprocessor), shows its status and error types only.What can still contain data of a document:
Data store plugins need no change, and existing plugin jars work: the exception is still thrown to them. Their warnings, crawl statistics and settings that stop a crawl on an error behave as before, and a failed commit still logs an error and keeps the old documents of that data configuration.
Web and file crawls get the same exception, never marked as recorded, so their handling is unchanged; their log output differs in the class name and in the description of a rejection.
Limits:
Tests
IndexUpdateCallbackImplRejectionTest: a rejected document of another data configuration, a rejected document that filled the cache, a commit with twelve rejected documents and wrapped exceptions, a record that cannot be stored, a response that cannot be matched, and another kind of failure.FailureUrlServiceTestandIndexingHelperTest. Those for the description use error responses of OpenSearch 3.10.1 (two kinds of date format, numbers out of range, a value that looks like the preview, IP address, boolean, geo point, date range, completion, vector dimension, a term that is too long, two ingest processors, a strict mapping and a write block) and check the warning, the exception message and the description kept for the failure URL.IndexUpdateCallbackImplandFailureUrlService, five of the new tests fail. With the earlier way of describing a rejection, 18 of the 52 tests inIndexingHelperTestandIndexUpdateCallbackImplRejectionTestfail, 14 of them because a value is found.To find where values are repeated, single bad values were sent to OpenSearch 3.10.1 for these mapping types: date, date_nanos, long, integer, short, byte, float, half_float, double, scaled_float, unsigned_long, ip, boolean, geo_point, geo_shape, xy_point, integer_range, date_range, ip_range, knn_vector, keyword, object, nested, a strict mapping, binary, rank_feature, rank_features, token_count, completion, join, percolator, flat_object, wildcard, search_as_you_type, a field alias and constant_keyword; for the ingest processors date, convert, json, grok, fail, script, rename, bytes and urldecode; and for a write block, a field limit and a too long ID.
Checked on a running Fess with OpenSearch 3.10.1, with the changed classes put into a build of main and the released 15.9.0 jar of fess-ds-csv:
CsvListDataStorewith one rejected file: one failure URL for the file.Checked by unit test only: web and file crawls, and data stores that stop on an error. Other data store plugins were checked by reading their error handling, not by running them.