From c86032f43b7bccb861c33769385db7a522e75513 Mon Sep 17 00:00:00 2001 From: Thomas Frey <49121001+elderbit@users.noreply.github.com> Date: Mon, 2 Feb 2026 22:42:02 +0100 Subject: [PATCH] Convert PlayerBots tables to InnoDB (#2083) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert PlayerBots tables to InnoDB (disable strict mode during conversion) # Pull Request ### This change converts the PlayerBots-related tables from MyISAM to InnoDB. **Why this is beneficial (even without fixing a specific bug):** - Crash safety & data integrity: InnoDB is transactional and uses redo logs; it provides automatic crash recovery, unlike MyISAM which can require manual repairs after unclean shutdowns. - Row-level locking: InnoDB reduces write contention and improves concurrency under bot-heavy workloads compared to MyISAM’s table-level locks. - Consistent reads: InnoDB supports MVCC, enabling stable reads while writes are happening—useful for mixed read/write access patterns. - Operational robustness: Better behavior under backup/restore and replication scenarios; fewer “table marked as crashed” style issues. Strict mode handling: The migration toggles innodb_strict_mode off only for the session to prevent the conversion from failing on edge-case legacy definitions, then re-enables it immediately after. --- ## How to Test the Changes - Step-by-step instructions to test the change Run the SQL script in the Playerbot database. - Any required setup (e.g. multiple players, bots, specific configuration) No - Expected behavior and how to verify it All tables should now have been converted from InnoDB to MyISAM. This script should return nothing: ``` SELECT t.TABLE_SCHEMA AS db_name, t.TABLE_NAME AS table_name, t.ENGINE AS storage_engine FROM information_schema.TABLES t WHERE t.TABLE_SCHEMA = DATABASE() -- With phpMyAdmin, use the following and insert your database name, e.g., “acore_playerbots.” -- WHERE t.TABLE_SCHEMA = 'YOUR_PLAYERBOT_DB' AND t.TABLE_TYPE = 'BASE TABLE' AND t.ENGINE = 'MyISAM' ORDER BY t.TABLE_NAME; ``` ## Complexity & Impact - Does this change add new decision branches? - [x] No - [ ] Yes (**explain below**) - Does this change increase per-bot or per-tick processing? - [x] No - [ ] Yes (**describe and justify impact**) - Could this logic scale poorly under load? - [x] No - [ ] Yes (**explain why**) --- ## Defaults & Configuration - Does this change modify default bot behavior? - [x] No - [ ] Yes (**explain why**) --- ## AI Assistance - Was AI assistance (e.g. ChatGPT or similar tools) used while working on this change? - [x] No - [ ] Yes (**explain below**) --- ## Final Checklist - [x] Stability is not compromised - [x] Performance impact is understood, tested, and acceptable - [ ] Documentation updated if needed - [x] I tested this script on a server with 2000 bots for 6 days (running 24/h) and had no issues with it. --- ## Notes for Reviewers Anything that significantly improves realism at the cost of stability or performance should be carefully discussed before merging. --- .../updates/2026_01_30_00_change_to_InnoDB.sql | 9 +++++++++ .../updates/2026_01_30_00_change_to_InnoDB.sql | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 data/sql/characters/updates/2026_01_30_00_change_to_InnoDB.sql create mode 100644 data/sql/playerbots/updates/2026_01_30_00_change_to_InnoDB.sql diff --git a/data/sql/characters/updates/2026_01_30_00_change_to_InnoDB.sql b/data/sql/characters/updates/2026_01_30_00_change_to_InnoDB.sql new file mode 100644 index 00000000..8c2c226b --- /dev/null +++ b/data/sql/characters/updates/2026_01_30_00_change_to_InnoDB.sql @@ -0,0 +1,9 @@ +-- Temporarily disables innodb_strict_mode for the session to allow the script to complete even if legacy table definitions contain InnoDB-incompatible attributes +SET SESSION innodb_strict_mode = 0; + +-- Change the tables to InnoDB +ALTER TABLE playerbots_guild_names ENGINE=InnoDB; +ALTER TABLE playerbots_names ENGINE=InnoDB; + +-- Re-enables innodb_strict_mode +SET SESSION innodb_strict_mode = 1; diff --git a/data/sql/playerbots/updates/2026_01_30_00_change_to_InnoDB.sql b/data/sql/playerbots/updates/2026_01_30_00_change_to_InnoDB.sql new file mode 100644 index 00000000..c7f9c51f --- /dev/null +++ b/data/sql/playerbots/updates/2026_01_30_00_change_to_InnoDB.sql @@ -0,0 +1,18 @@ +-- Temporarily disables innodb_strict_mode for the session to allow the script to complete even if legacy table definitions contain InnoDB-incompatible attributes +SET SESSION innodb_strict_mode = 0; + +-- Change the tables to InnoDB +ALTER TABLE playerbots_dungeon_suggestion_abbrevation ENGINE=InnoDB; +ALTER TABLE playerbots_dungeon_suggestion_definition ENGINE=InnoDB; +ALTER TABLE playerbots_dungeon_suggestion_strategy ENGINE=InnoDB; +ALTER TABLE playerbots_equip_cache ENGINE=InnoDB; +ALTER TABLE playerbots_item_info_cache ENGINE=InnoDB; +ALTER TABLE playerbots_rarity_cache ENGINE=InnoDB; +ALTER TABLE playerbots_rnditem_cache ENGINE=InnoDB; +ALTER TABLE playerbots_tele_cache ENGINE=InnoDB; +ALTER TABLE playerbots_travelnode ENGINE=InnoDB; +ALTER TABLE playerbots_travelnode_link ENGINE=InnoDB; +ALTER TABLE playerbots_travelnode_path ENGINE=InnoDB; + +-- Re-enables innodb_strict_mode +SET SESSION innodb_strict_mode = 1;