Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

handle rt and plain indices the same - #1249

Merged
pat merged 1 commit into
pat:developfrom
akostadinov:develop
Aug 11, 2023
Merged

pat merged 1 commit into
pat:developfrom
akostadinov:develop

Conversation

@akostadinov

@akostadinov akostadinov commented Aug 2, 2023 •

Copy link
Copy Markdown
Contributor

because of my oversight in #1222 all rt indices lost the sphinx_internal_class_name field and this is not correct. In either index type, when single table inheritance is used, then sphinx_internal_class_name should be present. Now also added a test for it - to make sure both index types are handled.

@akostadinov
akostadinov marked this pull request as draft August 3, 2023 19:55
let(:index_a) { double 'Index A', :model => model_a, :type => 'plain',
:sources => [double(:fields => [field_a1, field_a2])] }
let(:index_b) { double 'Index B', :model => model_a, :type => 'rt',
let(:index_b) { double 'Index B', :model => model_b, :type => 'rt',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got me in trouble originally. index_a should use model_a and index_b should use model_b as far as I understand the intention of the test case.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As much as I can tell, yes, I think you're right! Thanks for this PR :)

@akostadinov
akostadinov marked this pull request as ready for review August 10, 2023 14:28
@pat
pat merged commit 5caa63f into pat:develop Aug 11, 2023
akostadinov added a commit to akostadinov/porta that referenced this pull request Sep 13, 2025
Sometimes after start-up Sidekiq pods produce ThinkingSphinx::QueryError

> unknown column: 'sphinx_internal_class_name' - REPLACE INTO account_core (id, `sphinx_internal_class_name`, `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 (14978, 'Account', 'org_name-lkdjfggf-serch-yyith8w', '156', 'username-lkdjfggf-serch-xskw25c', ' ', 'username-lkdjfggf-serch-xskw25c@anything.invalid', 'af61253a5933dd9ba30bebb6661d16d1 ede2926ef59ecdc45da4a8960164ffc2', '3173be1c fc507eb9', 'org_name-lkdjfggf-serch-yyith8w's App ui_accou-lkdjfggf-accont-vmt8wba', '180', 156, 'Account', 0, 1697580778, 2, 2, 'approved')

A potential cause for this is load order of thinking-sphinx indices vs the monkey patch we are removing here.

Since we use thinking-sphinx 5.5 which has this logic alread merged in pat/thinking-sphinx#1249 , we can just remove the monkey patch and a race condition should not have any opportunit to happen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants