3.9 KiB
Bazaar Item Unique ID And Offline Trading Rollout
Purpose
This rollout converts persisted item identity and offline trader or buyer session state to the new production-safe model. The migration is designed for a maintenance window and explicitly clears any in-flight trader, buyer, and offline sessions during cutover.
Do not reopen the server until every verification step passes.
Preconditions
- Schedule a maintenance window.
- Stop new logins before beginning the migration.
- Ensure the
worldbinary you are deploying includes this branch. - Ensure operators have credentials to run schema updates and database dump commands.
Mandatory Backup
Take a backup before any schema or migration command:
world database:dump --player-tables --login-tables --dump-path=backups --compress
If you use a separate database backup process, complete it before continuing.
Local Dev Validation
Run these commands against the local dev database before production:
world database:updates --skip-backup
world database:item-unique-ids --preflight --verbose
world database:item-unique-ids --migrate --verbose
world database:item-unique-ids --verify --verbose
Validate these gameplay scenarios after the migration:
- Two traders listing the same item at different prices.
- One trader changing a price without affecting another trader.
- Offline trader purchase.
- Offline buyer purchase.
- Parcel retrieval for rows that previously had missing
item_unique_idvalues. - Alternate bazaar shard search.
Production Sequence
- Bring the server into maintenance mode and stop new gameplay activity.
- Take the mandatory backup.
- Apply schema updates:
world database:updates
- Run the migration preflight:
world database:item-unique-ids --preflight --verbose
- If preflight reports missing schema, duplicate live item IDs, or other unexpected errors, stop and resolve them before continuing.
- Run the migration:
world database:item-unique-ids --migrate --verbose
This step clears active trader, buyer, and offline session state. Players must re-enter those modes after deploy.
- Run final verification:
world database:item-unique-ids --verify --verbose
- Reopen the server only after verification passes.
What Preflight And Verify Must Show
The migration is not complete unless all of the following are true:
inventory,sharedbank, andtradercontain no null or blankitem_unique_idvalues.character_parcels,character_parcels_containers, andinventory_snapshotscontain no null or blankitem_unique_idvalues.inventory,sharedbank, andtradercontain no duplicateitem_unique_idgroups.- There are no cross-table duplicate live
item_unique_idvalues acrossinventory,sharedbank, andtrader. offline_character_sessionsis empty after migration.account.offlinehas no rows left set to1.
Rollback Criteria
Rollback instead of reopening the server if any of the following occur:
world database:updatesfails.world database:item-unique-ids --preflightreports missing required schema.world database:item-unique-ids --migrateor--verifyreports missing IDs, duplicate IDs, or stale offline session state.- Bazaar listing, offline trader, offline buyer, or parcel retrieval smoke tests fail after migration.
Rollback Actions
- Keep the server in maintenance mode.
- Restore the database backup taken before the rollout.
- Redeploy the previous server build.
- Confirm login, trader, buyer, and parcel behavior on the restored build before reopening the server.
Notes
world database:item-unique-ids --keep-trading-stateexists for non-production diagnostics only. Do not use it during production cutover.- The migration command expects schema updates to have been applied first. If required tables or columns are missing, the command fails and should not be bypassed.