Remove intermediate SaveToDB calls in PlayerbotFactory::Randomize#366
Draft
Copilot wants to merge 1 commit into
Draft
Remove intermediate SaveToDB calls in PlayerbotFactory::Randomize#366Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
…1 save per cycle)
Copilot
AI
changed the title
Coalesce SaveToDB calls in PlayerbotFactory::Randomize (Change 2 of async DB write-sharding follow-up)
Remove intermediate SaveToDB calls in PlayerbotFactory::Randomize
Jun 12, 2026
Copilot created this pull request from a session on behalf of
billy1arm
June 12, 2026 19:27
View session
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
✅ Build Mangos ZERO Server 22.04.330-ntbigniq completed (commit 6ba524ad99 by @Copilot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the async DB write-sharding series.
PlayerbotFactory::Randomizewas flushing to DB three times mid-randomize before the final save, unnecessarily serializing shard writes and providing no durability value (bots re-randomize from scratch on restart anyway).Changes
src/modules/Bots/playerbot/PlayerbotFactory.cpp— removed three intermediatebot->SaveToDB()calls insideRandomize(bool incremental): after the reset phase, after quest init, and after trade skill update. The single final save (after all initialization — quests, spells, skills, equipment, pet, money) is retained. Count perRandomizeinvocation: 4 → 1.Blocked: Change 1 —
Player::DeleteFromDBshard keyBeginTransaction(lowguid)atPlayer.cpp:5207requires aBeginTransaction(uint32 shardKey)overload that does not exist in this repo — commits 6b63ea2 / 4d0901b (the GUID-shard dispatch layer) are absent from this tree. Applying the call produces:Change 1 is deferred until the sharding infrastructure in
src/shared/Database/is landed.This change is