1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Bytes and statement streaming unit.

This commit is contained in:
Teemu Ollakka
2018-06-13 16:51:23 +03:00
parent 94b4d3a7db
commit 37efaba3e5
7 changed files with 166 additions and 19 deletions

View File

@ -111,16 +111,25 @@ int wsrep::transaction_context::after_row()
switch (streaming_context_.fragment_unit())
{
case streaming_context::row:
streaming_context_.increment_unit_counter();
if (streaming_context_.fragments_certified()
+ streaming_context_.unit_counter() >=
streaming_context_.increment_unit_counter(1);
if (streaming_context_.unit_counter() >=
streaming_context_.fragment_size())
{
streaming_context_.reset_unit_counter();
return certify_fragment(lock);
}
break;
case streaming_context::bytes:
if (client_context_.bytes_generated() >=
streaming_context_.bytes_certified()
+ streaming_context_.fragment_size())
{
return certify_fragment(lock);
}
break;
default:
assert(0);
case streaming_context::statement:
// This case is checked in after_statement()
break;
}
}
return 0;
@ -463,6 +472,18 @@ int wsrep::transaction_context::after_statement()
state() == s_cert_failed ||
state() == s_must_replay);
if (state() == s_executing &&
streaming_context_.fragment_size() &&
streaming_context_.fragment_unit() == streaming_context::statement)
{
streaming_context_.increment_unit_counter(1);
if (streaming_context_.unit_counter() >= streaming_context_.fragment_size())
{
streaming_context_.reset_unit_counter();
ret = certify_fragment(lock);
}
}
switch (state())
{
case s_executing: