-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#21853: Allow mview indexers to use different entity columns. #21857
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
#21853: Allow mview indexers to use different entity columns. #21857
Conversation
Hi @nikunjkotecha. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@akaplya could you check if current behavior is intentional? |
Hello, I just experiencing the same issue and IMO it's not an intentional behavior since the result changes depending on the way you set the indexing mode on all the indexes or on a single one. |
@magento-engcom-team How shall we proceed with this? Merge this proposed change for the time being, or is further work required? |
@slavvka you moved this PR to "on hold", could you describe why and what we're waiting for? |
@ihor-sviziev sorry for not having added the explanation. We are waiting for the review from Magento architect team |
@nikunjkotecha while we're waiting for Architecture team review - could you sign Adobe CLA? |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change the logic in order to read the correct column name in the buildStatement
method instead of create
and delete
.
The issue is caused because thе changelog is missing subscription column name.
@@ -117,8 +117,19 @@ public function create() | |||
|
|||
// Add statements for linked views | |||
foreach ($this->getLinkedViews() as $view) { | |||
// Store current column name for reverting back later. | |||
$originalColumnName = $this->getColumnName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution looks like we are trying to hack the subscription logic by changing object property and misuse the columnName
.
What we actually need is subscription column name, not the changelog column name (which is all the time the same).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lenaorobei I looked at the code again and your comment and it's a bit confusing
1/ It seems we both agree we need to use the subscription column name
2/ I'm not sure why you mention not the changelog column name
, we need two column names - changelog column is for the changelog table and that's not going to change (even you mentioned same). What we need is to change how we read the subscription column name
My understanding, Subscription is created once for all the subscribers together and whichever subscription we modify last - columnName is used from that and re-used for all the triggers.
I've tried to simplify the code to make it look not (or less) hacky but to me it seems changes are required in the same direction as I've taken or a major rework would be required in how the subscriptions are created (refactor how the statement is built for linked views)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, we need both changelog and subscription column names, but $this->getColumnName()
is changelog column, not the subscription one.
I recommended to move the logic of getting its name to the buildStatement
method in order to cover both cases - create and delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any object / data available as of now in buildStatement to get the column name of the linked view for which buildStatement is called.
We can pass full view object or the way I've done to pass the subscription name, please advice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we can get view
from the changelog
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at-least as per the interface
I may be wrong, please guide if I'm missing something here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
Let's pass the view object then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
# Conflicts: # lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php # lib/internal/Magento/Framework/Mview/View/Subscription.php
@magento run all tests |
Hi @ihor-sviziev, thank you for the review. |
✔️ QA Passed The result is the same as in the report above #21857 (comment) |
@magento run all tests |
@magento run Functional Tests EE |
@magento run Functional Tests B2B |
@magento run Functional Tests EE |
@magento run Functional Tests B2B |
@magento run Functional Tests EE |
@magento run all tests |
Hi @nikunjkotecha, thank you for your contribution! |
Fixes: #21853
Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/413
This is not final expected change and only here to show the issue and proposed direction for the fix.