Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlitecluster/SQLite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ void SQLite::rollback(const string& commandName)
SINFO("Transaction was automatically rolled back, not sending 'ROLLBACK'.");
} else {
if (_uncommittedQuery.size()) {
SINFO("Rolling back transaction: " << _uncommittedQuery.substr(0, 100));
SINFO("Rolling back transaction: " << BedrockPlugin_Compression::decompress(_uncommittedQuery).substr(0, 100));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound work when logging the rollback prefix

For transactions containing large expanded SQL or many statements, this computes an entire copy of an uncompressed _uncommittedQuery, or fully decompresses a prepared query, before discarding everything after 100 bytes. A rollback after prepare() performs this allocation while still holding commitLock, so memory pressure can throw before the SQLite rollback and mutex release, while ordinary large rollbacks unnecessarily block other commits. Preserve a bounded plaintext prefix before compression or use a decompression path that stops after the log limit.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preserve a bounded plaintext prefix before compression

Can we do this?

}
uint64_t before = STimeNow();
SASSERT(!SQuery(_db, "ROLLBACK"));
Expand Down
Loading