-
-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a query is successfully processed via Buddy log it in the original form #2235
Comments
I need concrete example what queries logs wrong as search, update, replace, system handles errors differently. SphinxQL and HTTP JSON handler also has different error processing. For example for search query it is hard to do for SphinxQL handler as:
|
For queries that will be passed to the Buddy, we can use the following, which is valid and should be handled by Buddy:
We need to track timings and all necessary information for logging to maintain a consistent format on the daemon side. |
daemon does not have any timings \ agent timings \ io and cpu counters \ total counters when got reply from buddy. If these should be put into log to query looks like original buddy should collect these metrics and provide them into daemon. Another case is that daemon passes all the failed requests into buddy but query_log has only search requests if daemon will log all source strings after buddy handles these well query_log will have inserts \ updates \ bulk \ call keywords and so on. Buddy should reply into daemon with the handled request type to filter out requests and log only search requests. The only daemon has is the source query string (SphinxQL or JSON) and it can log it as is, ie if the query_log_format option is |
after the discussion with the @sanikolaev it worth to change response from Buddy to Manticore Search to include the new object
These could be get by buddy by the
Without the new flag \ object daemon has no information is it the search query and should be log into query.log or the bulk \ insert \ ALTER or some system query and should be skipped |
As discussed before, instead of using |
We should process and try to log it with daemon. We can validate it by using the following MRE: mysql> create table test(name text) min_infix_len='1';
mysql> select * from test where match('hello') option fuzzy = 1; And we will get response from buddy as follows:
Let's proceed with logging such queries. In case we have no meta info it will be |
merged at 210b06c and now if SphinxQL request to buddy passed well it logs into query log |
not sure if @PavelShilin89 should add test for this case or not |
Absolutely, let's add a CLT test which tests that various queries processed through Buddy are logged properly. |
@donhardman as we discussed, the remaining issue is that the daemon currently logs all queries processed through Buddy. Instead, we only want to log SELECT queries. Let's handle this by introducing a new |
wrong commit reference |
Blocked by manticoresoftware/manticoresearch-buddy#394 |
Let's check the |
…lines at the query log for error report and buddy report; fixed #2235
…lines at the query log for error report and buddy report; fixed #2235
should be fixed at 9222c03 now daemon does not log into query.log if the buddy reply has no |
Looks good to me. Reopening since there are non-checked items in the checklist. Assigning to @PavelShilin89 to prepare tests. These should include SQL/JSON select queries that are processed via Buddy and sent via MySQL/HTTP. The queries should be logged according to the documentation here: https://manual.manticoresearch.com/Logging/Query_logging#Query-logging |
* Bump buddy version to: 3.0.1 24111207 5d89277 * Bump buddy version to: 3.0.1 24111217 6707485 * Bump buddy version to: 3.0.1 24111305 f599a87 * Bump buddy version to: 3.0.1 24111407 3861c6b * fixed buddy reply routing at daemon for /cli endpoint (#2734) * fixed buddy reply routing at daemon for /cli endpoint; fixed #2269 * implemented jieba_user_dict_path (#2735) implemented jieba_user_dict_path * added log of the SphinxQL query that successfully processed by buddy into the query log; fixed #2235 * manual: Update Adding_documents_to_a_real-time_table.md * fixed query wrong length at error report at the query log; fixed new lines at the query log for error report and buddy report; fixed #2235 * Update regex for the new version of fluentbit (#2738) Co-authored-by: Pavel_Shilin <[email protected]> * manual: Update Query_logging.md Added that queries processed through Buddy are not logged in plain mode. * manual: minor changes * fix crash when add 1-st stored column That is very edge case when you alter a table adding stored column when there were no stored columns before. Test provided. That is related to #2708 * fixed JSON SI-related filter transforms vs small index * added collation support to Expr_JsonFieldIn_c * added log of the HTTP request that successfully processed with buddy into the query log; fixed #2235 * manual: WSL installation * fixed multiple stopwords from the lemmatize_xxx_all tokenizers increase hitpos of the following tokens; fixed #2704; added case to test 219 * fixed nsis builder script to use the same MANTICORE_DATE as zip package has * Test/drop sharded table (#2651) * Creating files for the test * Update test-drop-sharding-table.rec * Moved test-drop-sharding-table * Deleted buddy_path = manticore-executor /workdir/src/main.php * Added new sharded tables * Added new outputs * Fixed test-drop-sharding-table.rec * Added new cases for table deletion --------- Co-authored-by: Pavel_Shilin <[email protected]> * fixed mysql dll for indexer * set session meta for the buddy replies; fixed #2235 * added uuid_short select list expression function; fixed #2752; added cases to test 125 * manual: uuid_short() * Test/create table with data if not exists (#2760) * Update test-create-table-like-existing-table-with-data.rec * Added cases with different syntax of IF NOT EXISTS support --------- Co-authored-by: Pavel_Shilin <[email protected]> * New fuzzy search and autocomplete cases have been added --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Stas <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> Co-authored-by: Sergey Nikolaev <[email protected]> Co-authored-by: Pavel_Shilin <[email protected]> Co-authored-by: Aleksey N. Vinogradov <[email protected]>
Tests have already been developed previously covering these cases. |
Proposal:
We are currently logging all queries, both those with errors and those without. However, when a query is proxied to the Buddy and the Buddy processes it successfully, we do not log those queries at all. We only log when an error is returned.
We should log all successfully processed queries that were originally erroneous but were proxied to the Buddy. If the Buddy returns an OK result for a query that initially had an error, we should log the ORIGINAL query as successful since it was processed without error with the help of the Buddy.
Checklist:
To be completed by the assignee. Check off tasks that have been completed or are not applicable.
The text was updated successfully, but these errors were encountered: