Development tools Yabo sports a pit of MySQL operation

First, explain
the beginning of the story is this, Yabo sports (yb880 dot cn) table a field type varchar (3), based on business needs change varchar (6), these are normal. DBA needs to be done as follows:

1, view the storage space
df -h
2, see table size
50G large table
3, view the table structure
Show the Create the Table xxx \ G;
4, to see if the official support online DDL, whether it will rebuild the table, if the table lock, the analysis of the system the impact of master-slave replication is delayed and so on.
5, the test environment for testing
knock blackboard time has come to, DBA is often the log in directly to the database to perform the command, this is nothing wrong with the implementation of several tests milliseconds after completion of proper verification table structure will not affect the business, get notification develop ~

Second, the results
the same command executed in the production environment took more than 40 minutes, show processlist findings show that altering table, appeared abnormal situation, can not, should not, but encountered problems on the face like, all exceptions are there is a reason, as the detective himself, to explore what happens to it ~

Third, the analysis
1, the command is the same problem does not exist.
2, the tools are different, doubt? ? ? ?
3, phenomenon tells us that the table may be in rebuilding, why this is so.
4, this time the need for further analysis, which is the equivalent of a post-hoc analysis, it is difficult to MySQL, this time do not easily suspect that the official documentation error. The table structure out of view, you have to have enough patience and careful, watch what happens before and after the modification, you will find not null constraints into a default null, we do not change this limit ah, then go to the official online DDL, you will find that this action is needed rebuilding table, overjoyed, I feel like the answer. Navicat use tools to do a few tests to verify, reproduce the phenomenon, has also been verified. Finally infer navicat of the pit. Finally, like the use of small navicat partners can test it yourself, be sure to pro-test.

CONCLUSIONS
1, DBA do not like to use one of the tools to avoid the pit because the tool itself, because a pit could cause a major accident, can not afford.
2, the daily work environment is very complex site, just to give you a Party of the production machine, not the tool you want, do not you do nothing, the most direct command line, you can also analyze a ballpark.
3, to cultivate the habit, not to install X, which is the reason you feel your boss worth it.
4, do not be afraid pit, pit full of life, who do not pursue dug pit, frankly face like, the meaning of your existence is from the pit to climb out and move on.

Guess you like

Origin www.cnblogs.com/yb880cn/p/12433566.html