-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Missing records in search query, Manticore 5.0.2 #912
Comments
it could be better to provide reproducible example |
I'm afraid this bug is not reproducible in my lab setup, even with identical database. It requires a fair amount of reads and/or writes to occur. |
could you check the index with indextool and in case check passed well upload the index files into our FTP along with query that should return documents were missed? along with documents id these are missed? |
Thank you for your advice. My first step was to downgrade Manticore to I'll look into indextool. |
The problem showed up today. Indextool reports: check passed. Since this produced no usable result, I'll check if and how I can obtain the requested data for the FTP upload without violating confidentiality rules. Thank you for your patience and sorry for the long process. |
@kalsan |
@sanikolaev after thorough inspection of the index files, I'm certain that they are not the problem. I copied the same index files in both broken and working state. Both work perfectly fine in a lab, but the broken one only shows up 16 records where the working one shows 33. The file sizes are 38.3 KB (broken) vs 50.7 KB (working). Conclusion: The records are effectively not there anymore. Thus, the index files will be worthless to you, as they will simply contain roughly half of the data and be indistinguishable from a manual deletion of rows. Trying another strategy. Is there a way to log all writing transactions (not just queries and events), in particular deletion statements? |
you could set undocumented |
Thanks for the info. The logging is now set up appropriately and produces the DELETE log lines I was hoping for. If the application is responsible for the lost records, it will show up in the logs. I will run the results next week. |
The logging produced an interesting result:
We have seen
This means that the following issues are all related:
The reason this problem is not reproducible in a lab is because it only occurs when very large amounts of text are in the index. |
Additional info:
|
How do I reproduce it? For me it throws an error:
|
@sanikolaev thanks for looking into this. After months of debugging, I still haven't found a way of reliably reproducing this issue. However, it appears to be resolved with Sphinx 3.5.1, released in February. As the cause of the issue is still unclear, I'd suggest to close this issue and let the it be until someone else also runs into this. |
A little bit strange decision to close this because Sphinx 3.5.1 fixed it. Sphinx 3.x is unusable because it is not open source. And its fixes do not propagate to Manticore. Why I'm here is actually because with Manticore 6.2.12 I face this issue with I'm not sure how to reproduce exactly without thinking-sphinx but it appears to be a difference between Any manticore developer has any idea why that might be? |
you could reopen the issue with the reproducible case I see no point keep ticket open without any progress on the first step - to get reproducible example that shows the case. Without the case we can not start investigation and provide the fix. |
@tomatolog , makes sense, here I have something. I believe this is the same issue. Let me know if you want a new issue opened. And here's how to reproduce. Run once manticore server and then sphinx 2.2.11 with the attached configuration file (manticore.conf.gz). Also add the following data to them: REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (126, 'company1', '7', 'company1', ' ', 'foo7@example.net', '', '', '', '7', 7, 'Account', 0, 1701871556, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (144, 'company2', '8', 'company2', ' ', 'foo8@example.net', '', '', '', '8', 8, 'Account', 0, 1701871556, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (162, 'company3', '9', 'company3', ' ', 'foo9@example.net', '', '', '', '9', 9, 'Account', 0, 1701871557, 2, 2, 'approved');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (180, 'company4', '10', 'company4', ' ', 'foo10@example.net', '', '', '', '10', 10, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (198, 'company5', '11', 'company5', ' ', 'foo11@example.net', '', '', '', '11', 11, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (216, 'company6', '12', 'company6', ' ', 'foo12@example.net', '', '', '', '12', 12, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (234, 'company7', '13', 'company7', ' ', 'foo13@example.net', '', '', '', '13', 13, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (252, 'company8', '14', 'company8', ' ', 'foo14@example.net', '', '', '', '14', 14, 'Account', 0, 1701871557, 2, 2, 'approved');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (270, 'company9', '15', 'company9', ' ', 'foo15@example.net', '', '', '', '15', 15, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (288, 'company10', '16', 'company10', ' ', 'foo16@example.net', '', '', '', '16', 16, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (306, 'company11', '17', 'company11', ' ', 'foo17@example.net', '', '', '', '17', 17, 'Account', 0, 1701871557, 2, 2, 'created');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (324, 'company12', '18', 'company12', ' ', 'foo18@example.net', '', '', '', '18', 18, 'Account', 0, 1701871558, 2, 2, 'approved');
REPLACE INTO account_core (id, `name`, `account_id`, `username`, `user_full_name`, `email`, `user_key`, `app_id`, `app_name`, `user_id`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `sphinx_updated_at`, `provider_account_id`, `tenant_id`, `state`) VALUES (324, 'company12', '18', 'company12', ' ', 'foo18@example.net', '', '', '', '18', 18, 'Account', 0, 1701871558, 2, 2, 'created'); Then run these commands on both: SELECT * FROM account_core limit 2,4;
SHOW META: The result for manticore is:
While for sphinx it is:
I'm not sure whether data is the problem or the metadata only. For sure the metadata is a problem as mentioned in pat/thinking-sphinx#1213. And as far as I can tell accoding to documentation, thinking-sphinx is using and should be using Thank you! |
its a planned feature implicit cutoff described at our manual
in case you use default sorting implicit cutoff is on |
That's very important to know, thank you. I didn't see it in the migration notes because apparently it came later. Can it be set somehow globally to avoid the need to change the application? One other question, are there any other changes that would interfere with pagination as described in the blog post I linked in my previous comment? |
Actually, I just tried it again with SELECT * FROM account_core limit 2,4 OPTION cutoff=0; And the result is
Why does still total equal P.S. Thinking Sphinx already does |
Because
Unfortunately not. Another approach BTW is to just do |
@sanikolaev , in my previous comment I linked to this sphinx doc: They specifically advise against using Is Manticore's meaning of P.S. actually if you consider removing |
I have another opinion: The user can decide themselves how many pages/docs they want to show, if the
|
The point is that user cannot show all And again, is there any technical difficulty to make PS cutoff is fine, thinking-sphinx already sets that to PPS I honestly can't understand the SHOW_META documentation about |
By "show all total_found records" do you mean that if
Only from Sphinx user's standpoint.
It would be even more confusing than now. We'll of course think about backwards compatibility if we decide to remove
Then
That's why we are thinking about removing it at all. It's meaningless.
I've created this task to improve the docs #1670 . PRs are welcome. The docs are here https://github.com/manticoresoftware/manticoresearch/tree/master/manual |
That's not really a solution. I'm all talking about pagination, so it is not about viewing them at once. And I don't even care so much that the user can't see them all. It is more about UI design. With pagination usually users see first couple of pages and last couple of pages when many pages are available. And it is common for the users to go to the last page. If So it is necessary to have a META that will indicate the max records possible to be ever retrieved. Modifying From any pagination user standpoint of view, some way to get the max accessible from meta is important. I would argue that |
Valid point. The task to simplify it is #1607 |
I'm not sure the provided examples can be classified as typical applications or that they provide a full picture of the use cases. Here's a specific use case from the project I'm working on is This is a table of available accounts. Some installations may have 10 accounts, some - thousands (other objects are listed in a similar way but 1 example should illustrate well enough). The table can be filtered by multiple criteria (including full-text search) as well sorted. Must be easy for users to scroll easily through many pages. IMHO it's not practical to change the page selection elements depending on whether full-text search was used or not. Maybe it's good technically but I expect confusion from the users. If server already knows the max accessible number, why shouldn't it provide it through metadata? Subject to limitations for performance reasons that app developers can override like presently with the My undestanding is that there is no technical difficulty for Manticore to provide a max accessible value in META by something like
The task you created is nice and would resolve the use case in an alternative way. Thank you for it! I expect though that ops would prefer to set a high non-overridable |
It should be better from any user perspective. Presently that information is not available at all. If you want add another metadata field with same information (the max possible matches). Then it will be sphinx vs non-sphinx users. But also libraries can abstract this for the developer in this way without the need to add and match configuration options on server and client. |
BTW in newer Sphinx versions the
|
Regardless, such a meta would be useful whether we call it FYI presently I decided to hardcode this value of ThinkingSphinx::Masks::PaginationMask.prepend(Module.new do
def total_pages
return 0 unless search.meta['total_found']
# 1000 is the default server max_matches value. We should stay at or below the server setting here.
@total_pages ||= ([total_entries, 1000].min / search.per_page.to_f).ceil
end
end) |
The same behaviour is in Manticore, but previously you insisted that |
@sanikolaev , I assume For explanation of the issue, please check my comment starting #912 (comment) The difference with sphinx 2.11 comes when using limits for pagination purposes. For normal queries this metadata is irrelevant. The behavior is definitely different from sphinx 2.11 because the thinking-sphinx library properly paginates with it while it doesn't with manticore. See pat/thinking-sphinx#1239 Some people reported that it also worked with 3.x but it is not open source so it is not an option for me. As I said, it is really not that important whether manticore is fully sphinx compatible. But this is useful information, I assume easy for the server to return. Because server already has The workaround being to have a client option of total records that can be returned which has to be kept in sync with the server configuration by the developer/ops. |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Expected behavior
Return all records
Describe the environment:
Manticore 5.0.2 348514c86@220530 dev
Messages from log files:
No relevant log entries. Manticore is of the opinion that everything works as expected.
Additional context
Restarting Manticore does not help. Re-indexing a record type fixes the problem for that type for the next few days or weeks, after which the problem occurs again. Occurence is random and unpredictable.
I conducted experiments suggesting that this is a Manticore and not a ThinkingSphinx bug, see pat/thinking-sphinx#1230 (comment)
The text was updated successfully, but these errors were encountered: