mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Assert transaction is active before appending keys and data
Attempt to append keys while transaction is not active results in creating a transaction handle with id -1 (undefined). Assert that the transaction is `active()` before appending keys. Same for appending data.
This commit is contained in:
committed by
Teemu Ollakka
parent
14b3612a30
commit
13442a04d8
@ -235,6 +235,7 @@ int wsrep::transaction::assign_read_view(const wsrep::gtid* const gtid)
|
||||
|
||||
int wsrep::transaction::append_key(const wsrep::key& key)
|
||||
{
|
||||
assert(active());
|
||||
try
|
||||
{
|
||||
debug_log_key_append(key);
|
||||
@ -250,7 +251,7 @@ int wsrep::transaction::append_key(const wsrep::key& key)
|
||||
|
||||
int wsrep::transaction::append_data(const wsrep::const_buffer& data)
|
||||
{
|
||||
|
||||
assert(active());
|
||||
return provider().append_data(ws_handle_, data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user