Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADBDEV-6577: Use short-lived SPI contexts #40

Merged
merged 49 commits into from
Nov 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1701482
Use short-lived SPI contexts
RekGRpth Oct 28, 2024
ce6fc81
warn
RekGRpth Oct 28, 2024
7fabd15
format
RekGRpth Oct 28, 2024
d628f7c
transaction
RekGRpth Oct 28, 2024
cded6ba
fix
RekGRpth Oct 28, 2024
f5fd4ce
optimize
RekGRpth Oct 28, 2024
865f9f8
context
RekGRpth Oct 28, 2024
ff7ab07
inc
RekGRpth Oct 28, 2024
983283c
snapshot
RekGRpth Oct 28, 2024
90a6577
rename
RekGRpth Oct 29, 2024
4e81a71
use enum and bit mask
RekGRpth Oct 30, 2024
25684b4
fix
RekGRpth Oct 30, 2024
0b49c70
formet
RekGRpth Oct 30, 2024
8652e1a
fix
RekGRpth Oct 30, 2024
e41ea95
optimize
RekGRpth Oct 30, 2024
f64447a
opmimize
RekGRpth Oct 30, 2024
3897da2
upper
RekGRpth Oct 30, 2024
ea50d56
optimize
RekGRpth Oct 30, 2024
a33012b
fix
RekGRpth Oct 30, 2024
8ae3517
fix
RekGRpth Oct 30, 2024
ad3a95f
fix
RekGRpth Oct 30, 2024
0069950
use context and error
RekGRpth Oct 30, 2024
9356184
move connect closer to execute
RekGRpth Oct 30, 2024
56f770e
additional move
RekGRpth Oct 30, 2024
8db6ada
rm
RekGRpth Oct 30, 2024
77212b6
mv
RekGRpth Oct 30, 2024
bb37067
mv
RekGRpth Oct 30, 2024
02020c1
partial revert
RekGRpth Oct 30, 2024
1aaf144
mv
RekGRpth Oct 30, 2024
cc262d3
mv
RekGRpth Oct 30, 2024
5cde9fa
partial revert
RekGRpth Oct 30, 2024
7d135ec
simplify
RekGRpth Oct 30, 2024
909f31c
fix
RekGRpth Oct 30, 2024
f05e5c6
simplify
RekGRpth Oct 30, 2024
5691fee
revert
RekGRpth Oct 30, 2024
40e2ff4
fix
RekGRpth Oct 30, 2024
b2a7df4
nl
RekGRpth Oct 30, 2024
f0bd18e
simplify
RekGRpth Oct 31, 2024
b73cb13
unuify
RekGRpth Oct 31, 2024
eb44b0f
optimize
RekGRpth Oct 31, 2024
5550449
fix
RekGRpth Oct 31, 2024
0bae1e1
simplify
RekGRpth Oct 31, 2024
dbfa9ab
rename
RekGRpth Oct 31, 2024
b3b8175
rename
RekGRpth Oct 31, 2024
9e126e2
rename
RekGRpth Oct 31, 2024
88224e0
mv
RekGRpth Oct 31, 2024
e818c97
mv
RekGRpth Oct 31, 2024
11602fd
mv
RekGRpth Oct 31, 2024
3777151
remove redundant code
RekGRpth Oct 31, 2024
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
Prev Previous commit
Next Next commit
additional move
RekGRpth committed Oct 30, 2024

Verified

This commit was signed with the committer’s verified signature.
RekGRpth Georgy Shelkovy
commit 56f770ec100f29578dd324c03604fa295368cc6c
19 changes: 13 additions & 6 deletions src/diskquota.c
Original file line number Diff line number Diff line change
@@ -1154,8 +1154,9 @@ process_extension_ddl_message()
static void
do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_extension_ddl_message)
{
int state = 0;
int old_num_db = num_db;
bool pushed_active_snap = false;
bool ret = true;
int old_num_db = num_db;

/*
* Cache Errors during SPI functions, for example a segment may be down
@@ -1164,7 +1165,9 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_
*/
PG_TRY();
{
SPI_connect_wrapper(&state);
StartTransactionCommand();
PushActiveSnapshot(GetTransactionSnapshot());
pushed_active_snap = true;

switch (local_extension_ddl_message.cmd)
{
@@ -1191,16 +1194,20 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_
HOLD_INTERRUPTS();
EmitErrorReport();
FlushErrorState();
state |= IS_ABORT;
ret = false;
num_db = old_num_db;
RESUME_INTERRUPTS();
}
PG_END_TRY();

SPI_finish_wrapper(state);
if (pushed_active_snap) PopActiveSnapshot();
if (ret)
CommitTransactionCommand();
else
AbortCurrentTransaction();

/* update something in memory after transaction committed */
if (!(state & IS_ABORT))
if (ret)
{
PG_TRY();
{