Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3346723
D13212.id43958.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13212.id43958.diff
View Options
diff --git a/keyserver/src/database/migrations.js b/keyserver/src/database/migrations.js
--- a/keyserver/src/database/migrations.js
+++ b/keyserver/src/database/migrations.js
@@ -35,22 +35,39 @@
for (const {
version: idx,
migrationPromise: migration,
+ migrationType,
} of migrations.values()) {
if (idx <= dbVersion) {
continue;
}
try {
- await startTransaction();
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await startTransaction();
+ }
await migration();
await updateDBVersion(idx);
- await commitTransaction();
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await commitTransaction();
+ }
console.log(`(node:${process.pid}) migration ${idx} succeeded.`);
} catch (e) {
const transactionExceptionMessage = String(getMessageForException(e));
console.error(`(node:${process.pid}) migration ${idx} failed.`);
console.error(transactionExceptionMessage);
- await rollbackTransaction();
+
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await rollbackTransaction();
+ }
return false;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 9:41 AM (17 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2568321
Default Alt Text
D13212.id43958.diff (1 KB)
Attached To
Mode
D13212: [keyserver] only wrap migration in transaction if specified in migrationType
Attached
Detach File
Event Timeline
Log In to Comment