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

Fix attempt to replicate empty fragments

* Adds method wsrep::transaction::streaming_step() so that there is a
  single place where streaming context unit counter is udpated.
  The method also checks that some data has been generated before
  attempting fragment replication.
* Emit a warning if there is an attempt to replicate a fragment and
  there is no data to replicate.
This commit is contained in:
Daniele Sciascia
2019-01-07 11:45:28 +01:00
parent a9e2fdccfc
commit 4ac15e4349
7 changed files with 106 additions and 41 deletions

View File

@ -86,8 +86,22 @@ namespace wsrep
* otherwise false.
*/
virtual bool statement_allowed_for_streaming() const = 0;
/**
* Return the total number of bytes generated by the transaction
* context.
*/
virtual size_t bytes_generated() const = 0;
/**
* Prepare a buffer containing data for the next fragment to replicate.
*
* @return Zero in case of success, non-zero on failure.
* If there is no data to replicate, the method shall return
* zero and leave the buffer empty.
*/
virtual int prepare_fragment_for_replication(wsrep::mutable_buffer&) = 0;
/**
* Remove fragments from the storage within current transaction.
* Fragment removal will be committed once the current transaction
@ -115,7 +129,6 @@ namespace wsrep
//
// Interface to global server state
//
/**
* Forcefully shut down the DBMS process or replication system.
* This may be called in situations where