Skip to content
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

@engcom-Hotel Reproduced #39206 issue in 2.4.7-p1 #39530

Open
senthilengg opened this issue Jan 10, 2025 · 7 comments · May be fixed by #39540
Open

@engcom-Hotel Reproduced #39206 issue in 2.4.7-p1 #39530

senthilengg opened this issue Jan 10, 2025 · 7 comments · May be fixed by #39540
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.7-p1 Indicates original Magento version for the Issue report.

Comments

@senthilengg
Copy link

senthilengg commented Jan 10, 2025

@engcom-Hotel I am able to reproduce the same issue in 2.4.7-p1.

Steps to Reproduce

  1. Change Encryption Key from Admin
  2. Remove the old encryption key from app/etc/env.php and Save
  3. Check the indexer_state, note down the updated at for all the rows
  4. Run setup upgrade. You can found out that indexer status was updated and hash values are changed
  5. In case of hash change customer_flat_grid data will be refreshed

Here is the indexer status from my local before and after

Screenshot 2025-01-10 at 11 19 54 AM

I would suggest re-open the issue

Originally posted by @senthilengg in #39206 (comment)

Copy link

m2-assistant bot commented Jan 10, 2025

Hi @senthilengg. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@senthilengg senthilengg changed the title @engcom-Hotel I am able to reproduce the same issue in 2.4.7-p1. @engcom-Hotel Reproduced #39206 issue in 2.4.7-p1 Jan 10, 2025
@github-project-automation github-project-automation bot moved this to Ready for Confirmation in Issue Confirmation and Triage Board Jan 13, 2025
@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p1 Indicates original Magento version for the Issue report. label Jan 13, 2025
senthilengg added a commit to senthilengg/magento2 that referenced this issue Jan 14, 2025
Update indexer hash up on Creation of new encryption key
senthilengg added a commit to senthilengg/magento2 that referenced this issue Jan 14, 2025
Updating indexer state hash upon creation of new encryption key from admin
senthilengg added a commit to senthilengg/magento2 that referenced this issue Jan 14, 2025
…ssue-39530

Fix for issue magento#39530 to avoid regenerating admin grid flat table
@engcom-Hotel engcom-Hotel self-assigned this Jan 15, 2025
Copy link

m2-assistant bot commented Jan 15, 2025

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @senthilengg,

Thanks for the report and collaboration!

We have tried to follow the mentioned steps and for us, the indexer_state has been updated:

Previously it was something like below:

Image

After running bin/magento s:up && bin/magento cache:clean:

Image

The hash_config is also updating. But it seems to us an intended behaviour please let us know the expected and actual result to understand more about the issue.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Jan 15, 2025
@senthilengg
Copy link
Author

senthilengg commented Jan 15, 2025

@engcom-Hotel Its not only updating the hash of the indexer but also regenerate the whole grid data again. Assume a situation if you have 4 million customer data and the grid table got truncated and recreated then it introduces significant downtime for no use.

Ideally the encryption key should update the hash alone and not the grid data because there is no business need to do that and it creates a huge downtime for the merchants if they have million plus customers.

Expected Result : Hash should update on the indexer_state without regenerating the grid data.
Actual Result: Grid table getting truncated and getting recreated again for no reason.

@engcom-Hotel
Copy link
Contributor

Hello @senthilengg,

After looking into the codebase, we haven’t found any indication that the indexer_state table has been truncated, but yes, it is updating the rows. The indexer_state table maintains the state of various indexers (e.g., valid, reindex required, etc.). However, suppose encrypted data tied to the indexers (like catalog data or configuration data) is updated as part of the encryption process. In that case, the indexer_state table might be updated to indicate that certain indexers require reindexing.

After encryption key changes, data that depends on encrypted values might become stale and require reindexing. Magento will update the indexer_state table for any indexers that need reindexing.

Thanks

@senthilengg
Copy link
Author

@engcom-Hotel if you read carefully I have mentioned its regenerating the grid data customer grid, sales ordergrid etc. Indexer state suppose to be update but not the customer grid data which will create a huge downtime for the customer during the next setup:upgrade.

@senthilengg
Copy link
Author

@engcom-Hotel i have also submitted a PR to fix the issue, once you are able to confirm the issue please help review the PR as well. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.7-p1 Indicates original Magento version for the Issue report.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants