Page MenuHomePhabricator

Grant "sockpuppet_import" user INDEX on "sockpuppet" database
Closed, ResolvedPublic

Description

Having populated data using the sockpuppet_import user, we need to create indexes on the new data imported - would it be possible to have INDEX granted to the same user?

Currently we cannot create indices:

mysql:sockpuppet_import@m2-master.eqiad.wmnet [sockpuppet]> CREATE INDEX IF NOT EXISTS `ix_coedit_user_text` ON `sockpuppet`.`coedit` (user_text);
ERROR 1142 (42000): INDEX command denied to user ‘sockpuppet_import’@‘10.64.0.135’ for table ‘coedit’

These are the operations the sockpuppet_import user executes, just for reference: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/similar-users/+/refs/heads/main/migrations/create.sql

Event Timeline

LSobanski triaged this task as Medium priority.Jan 20 2021, 7:44 PM
LSobanski moved this task from Triage to Refine on the DBA board.
WDoranWMF raised the priority of this task from Medium to High.Jan 20 2021, 7:46 PM
WDoranWMF added a subscriber: LSobanski.

@LSobanski I'm raising this to high priority as this is a blocker for us to debug a significant issue for us. Let me know if that is not reasonable.

Change 657468 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] production-m2.sql.erb: Add INDEX grant to sockpuppet_import user

https://gerrit.wikimedia.org/r/657468

Change 657468 merged by Marostegui:
[operations/puppet@production] production-m2.sql.erb: Add INDEX grant to sockpuppet_import user

https://gerrit.wikimedia.org/r/657468

This is done

root@db1107.eqiad.wmnet[(none)]> show grants for `sockpuppet_import`@`10.64.16.19`; show grants for `sockpuppet_import`@`10.64.0.135`; show grants for  `sockpuppet_import`@`10.192.16.9`;
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for sockpuppet_import@10.64.16.19                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `sockpuppet_import`@`10.64.16.19` IDENTIFIED BY PASSWORD '*xx' |
| GRANT INSERT, CREATE, DROP, INDEX ON `sockpuppet`.* TO `sockpuppet_import`@`10.64.16.19`                                   |
+----------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)

+----------------------------------------------------------------------------------------------------------------------------+
| Grants for sockpuppet_import@10.64.0.135                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `sockpuppet_import`@`10.64.0.135` IDENTIFIED BY PASSWORD '*xx' |
| GRANT INSERT, CREATE, DROP, INDEX ON `sockpuppet`.* TO `sockpuppet_import`@`10.64.0.135`                                   |
+----------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)

+----------------------------------------------------------------------------------------------------------------------------+
| Grants for sockpuppet_import@10.192.16.9                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `sockpuppet_import`@`10.192.16.9` IDENTIFIED BY PASSWORD '*xx' |
| GRANT INSERT, CREATE, DROP, INDEX ON `sockpuppet`.* TO `sockpuppet_import`@`10.192.16.9`                                   |
+----------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)

If you need something else please re-open