1. 31 Mar, 2010 1 commit
    • Alfranio Correia's avatar
      BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates · 7827688f
      Alfranio Correia authored
      BUG#46364 introduced the flag binlog_direct_non_transactional_updates which
      would make N-changes to be written to the binary log upon committing the
      statement when "ON". On the other hand, when "OFF" the option was supposed
      to mimic the behavior in 5.1. However, the implementation was not mimicking
      the behavior correctly and the following bugs popped up:
      
        Case #1: N-changes executed within a transaction would go into
                 the S-cache. When later in the same transaction a
                 T-change occurs, N-changes following it were written
                 to the T-cache instead of the S-cache. In some cases,
                 this raises problems. For example, a
                 Table_map_log_event being written initially into the
                 S-cache, together with the initial N-changes, would be
                 absent from the T-cache. This would log N-changes
                 orphaned from a Table_map_log_event (thence discarded
                 at the slave). (MIXED and ROW)
      
         Case #2: When rolling back a transaction, the N-changes that
                  might be in the T-cache were disregarded and
                  truncated along with the T-changes. (MIXED and ROW)
      
         Case #3: When a MIXED statement (TN) is ahead of any other
                  T-changes in the transaction and it fails, it is kept
                  in the T-cache until the transaction ends. This is
                  not the case in 5.1 or Betony (5.5.2). In these, the
                  failed TN statement would be written to the binlog at
                  the same instant it had failed and not deferred until
                  transaction end. (SBR)
      
      To fix these problems, we have decided to do what follows:
      
         For Case #1 and #2, we circumvent them:
      
            1. by not letting binlog_direct_non_transactional_updates
               affect MIXED and RBR. These modes will keep the behavior
               provided by WL#2687. Although this will make Celosia to
               behave differently from 5.1, an execution will be always
               safe under such modes in the sense that slaves will never
               go out sync. In 5.1, using either MIXED or ROW while
               mixing N-statements and T-statements was not safe.
      
         For Case #3, we don't actually fix it. We:
      
            1. keep it and make all MIXED statements whether they end
               up failing or not or whether they are up front in the
               transaction or after some transactional change to always
               be stored in the T-cache. This means that it is written
               to the binary log on transaction commit/rollback only.
      
            2. We make the warning message even more specific about the
               MIXED statement and SBR.
      7827688f
  2. 10 Mar, 2010 1 commit
  3. 22 Feb, 2010 1 commit
    • Alfranio Correia's avatar
      BUG#49019 Mixing self-logging eng. and regular eng. does not switch to row in mixed mode · 7194aec8
      Alfranio Correia authored
      Reading from a self-logging engine and updating a transactional engine such as Innodb
      generates changes that are written to the binary log in the statement format and may
      make slaves diverge. In the mixed mode, such changes should be written to the binary
      log in the row format.
      
      Note that the issue does not happen if we mix a self-logging engine and MyIsam
      as this case is caught by checking the mixture of non-transactional and transactional
      engines.
      
      So, we classify a mixed statement where one reads from NDB and writes into another 
      engine as unsafe:
      
      if (multi_engine && flags_some_set & HA_HAS_OWN_BINLOGGING)
        lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE);
      7194aec8
  4. 21 Feb, 2010 1 commit
  5. 20 Feb, 2010 9 commits
  6. 19 Feb, 2010 2 commits
  7. 18 Feb, 2010 4 commits
  8. 17 Feb, 2010 14 commits
  9. 16 Feb, 2010 7 commits