Skip to content

Batch group meta data updates in a single DB transaction - #357

Open
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxs-grpmeta-batch-write
Open

Batch group meta data updates in a single DB transaction#357
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxs-grpmeta-batch-write

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

processGrpMetaChanges() wrote each queued group meta update in its own implicit SQLCipher transaction — one fsync per entry, measured at ~1 s each. Services accumulating many updates (typically identity usage stamps at startup, with a few thousand identity groups) froze their tick thread for up to 86 s while draining the queue.

This adds a vector variant of updateGroupMetaData() that wraps the whole batch in one transaction (same pattern as the message side), and makes processGrpMetaChanges() write all entries in one call. The same backlog is now absorbed in about a second.

🤖 Generated with Claude Code

processGrpMetaChanges() wrote each queued group meta update with its own
call to updateGroupMetaData(), i.e. one implicit SQLCipher transaction and
one fsync per entry. One such write was measured at ~1 s, and services
accumulating many updates (typically identity usage stamps at startup,
~3700 identity groups) froze their tick thread for as long as 86 s while
draining the queue, blocking all other GXS activity of the service through
mGenMtx.

Mirror the existing message-side batching: add a vector variant of
updateGroupMetaData() that wraps all row updates in a single transaction
(one fsync total), and make processGrpMetaChanges() collect the entries
that pass their mask and write them in one call.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jolavillette
jolavillette force-pushed the fix/gxs-grpmeta-batch-write branch from dd4bdea to 4efb9cb Compare August 6, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant