Skip to content

Commit 85b8150

Browse files
committed
fix for: allowing application to set transaction as PA unsafe
The new feature which allows application to set transaction as PA unsafe caused problems for streaming replication use cases. In apply_write_set(), it is assumed that write set flags must be 0 for existing streaming replication transaction. However, if SR transaction modifies non PK table, the replicated fragment may have pa_unsafe flag. Fixed by changing the condition detecting SR transactions to accept pa_unsafe flag. This avoids the apply_write_set() execution from falling down to assert(0) in the "condition tree"
1 parent 8884de3 commit 85b8150

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server_state.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ static int apply_write_set(wsrep::server_state& server_state,
359359
ws_meta,
360360
data);
361361
}
362-
else if (ws_meta.flags() == 0 || wsrep::prepares_transaction(ws_meta.flags()))
362+
else if (ws_meta.flags() == 0 || ws_meta.flags() == wsrep::provider::flag::pa_unsafe ||
363+
wsrep::prepares_transaction(ws_meta.flags()))
363364
{
364365
wsrep::high_priority_service* sa(
365366
server_state.find_streaming_applier(

0 commit comments

Comments
 (0)