• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 Online Schema Changes for Maximizing Uptime
 

Online Schema Changes for Maximizing Uptime

on

  • 879 views

PalominoDB's David Turner and Ben Black cover common operations implemented in production and how you can minimize downtime and customer impact

PalominoDB's David Turner and Ben Black cover common operations implemented in production and how you can minimize downtime and customer impact

Statistics

Views

Total Views
879
Views on SlideShare
879
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
2

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • selam RDS devresi şematik olarak varmı sizde .gönderebilirmisiniz?
    mail oryent@gmail.com
    Are you sure you want to
    Your message goes here
    Processing…
  • Online Schema Changes for Maximizing Uptime through DIRECT link
    COPY & PASTE the LINK
    ---> http://po.st/mX2cA1
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

     Online Schema Changes for Maximizing Uptime Online Schema Changes for Maximizing Uptime Presentation Transcript

    • Online Schema Changesfor Maximizing UptimePALOMINODBOPERATIONAL EXCELLENCEFOR DATABASESDavid TurnerBen Blackwww.palominodb.com
    • Palominodb: Who are we and what do we do?• Proactive database awesomeness so youcan focus on other things• Systems and Performance Optimization• Operational Best Practices• Devops• Ask us how we like working from anywhere
    • Online Schema Changes• Best practices• Online Schema Tools• PT Online Schema Change• Innodb Online DDL• Case Study
    • Best Practices• Backups• Benchmarko Start smallo Step upo Timeo Performance_schema and Information_schema
    • Repository• Prevento Broken Replicationo Data losso Broken applications
    • Creating the repository• Dump• Script
    • Syncing the repository• Migrations• Schema Changes• Scheduled
    • Problems• Schema changes• Fragmentation
    • You want to do what to that 40Gtable?• Down for Maintenance/blocking DDL• Disable writes• Remaster• Facebook OSC• Large Hadron Migrator• Openark-kit• Pt Online Schema Change• MySQL Innodb DDL - IOD
    • OSC Tools or how I learnedto love the alter...• copy original table structure to new table• alter new table• create triggers to copy dml from originaltable to new table• copy data in original table to new table inchunks• swap table names and drop original table
    • pt-online-schema-changePercona toolkit is your friend.Mature productPay attention to version you are using!!!FK issues, log_bin with 2.0screen - use it along with tee and time
    • Its all ball bearings nowadays--progress time,10 (default 30 seconds)--max-lag--recursion-method (how to find slaves)show processlistshow hostsdsn table (great for ignoring some slaves)
    • What could possibly go wrong?• PK/UK required• FK names will change on altered table• FKs reference table to alter--alter-foreign-keys-method drop_swapsets foreign_key_checks=0drops original table (hardlink!!!)renames new table
    • What could possibly go wrong?• non xfs table drops (create the hardlink!)o Can even cause innodb to crash mysqld• PKs with gaps• Largest table to alter vs free disk space• Disk space (2x for RBR)• Global mutexes (table drops)• table metadata locks (triggers)
    • NOOOOOO!!• Running PT-OSC against a slave with RBRReplication started erroring after pt-oscwhy???• And how about syncing a table using pt-oscwith RBR?
    • Set it and forget it???• watcho wo df -ho ls -alh ibd fileso mysql -e"show processlist;"|egrep -v "Sleep|repl"o slave lag• How is it affecting the application?• max-lag, max-load,
    • Features we like• Throttling• Nibbling• Reporting• Replicating• Reorgs
    • Innodb Online DDL - IOD• Looking back 5.1 and 5.5o Fast index creation• Enhancementso Online DDLo Inplace
    • Silver Bulletshttp://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html#innodb-online-ddl-summary-grid• Drop and add Index together• Temporary table index creation
    • Alter Online lock modes• Exclusive• Shared• Default• None* Note
    • Alter Online Algorithms• Inplace• Copy
    • Grouping DDL• Copy• Sequence• Lock
    • IOD Behavior• Metadata• Data volume• Type of index• Foreign keys• Partitioningo Add partition, drop partitiono Truncate partitiono Add partition and coalesce partition• Algorithm• Autoincrement• Locking
    • IOD Errors• Locking• Timeouts• Tmpdir• DML
    • IOD Crash Recovery• Secondary Indexes• Clustered Indexes (dont crash!)
    • Of Interest• Tmpdir• Dropping Indexes with Foreign keys• Cascade on• Inconsistent .frm
    • Monitoring• Rows Affected• Performance_schema andInformation_schema• Progress• Replication lag
    • IOD Server parms• innodb_online_alter_log_max_size• sort_buffer_size
    • Case Study• Ticketing system
    • Architecture• 1 master• 1 active slave• 1 analytics/indexing slave• 1 backup/reorg slave
    • Issues• Growth• Rebalancing Shards• Deletions• Reorgs
    • Timeline• Difficult failovers• Ticket Growth• FB OSC• PT OSC• Reorgs
    • QuestionsDavid Turnerdturner@palominodb.comBen Blackben@palominodb.comwww.palominodb.com