Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7924

"START SLAVE UNTIL <timestamp>" wanted

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
      None

      Description

      Please, could it be possible to implement "START SLAVE UNTIL <timestamp>"? It could be useful for backup purposes when a few slaves (of different masters) have to be in sync. Currently it is possible by searching binlogs for the given timestamp and setting "UNTIL MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos".

      "START SLAVE UNTIL <timestamp>" would greatly simplify this and also allow stopping in the future when a binlog entry with a greater timestamp arrives.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            danblack Daniel Black added a comment -

            using https://mariadb.com/kb/en/mariadb/global-transaction-id/ in mariadb-10+ I'd be looking at recording the gtid as part of the backup. Then recovery is set global gtid_slave_pos=...; CHANGE MASTER TO master_use_gtid = slave_pos; start slave; regardless of server.

            Timestamp is quite ambiguous when multiple transactions can happen in a millisecond.

            I totally agree that log file/pos between servers is a pain, which I suspect was one of the great motivators for gtid implementation.

            Show
            danblack Daniel Black added a comment - using https://mariadb.com/kb/en/mariadb/global-transaction-id/ in mariadb-10+ I'd be looking at recording the gtid as part of the backup. Then recovery is set global gtid_slave_pos=...; CHANGE MASTER TO master_use_gtid = slave_pos; start slave; regardless of server. Timestamp is quite ambiguous when multiple transactions can happen in a millisecond. I totally agree that log file/pos between servers is a pain, which I suspect was one of the great motivators for gtid implementation.
            Hide
            ip1981 Igor Pashev added a comment -

            > Timestamp is quite ambiguous when multiple transactions can happen in a millisecond.

            It should not matter when we use it for a cutoff: if (timestamp > stop_timestamp) stop;
            (Also "STOP SLAVE AFTER <timestamp>" could be also usable).

            I'm asking for no new features, just for a convenient way to do what is already possible.

            The point of this feature is the ability to make dumps of two or more different servers for the given point in time.
            We could stop masters at the same time, and then make dumps, but this is not an option Thus slaves
            and stopping replication at the same time, but this time we should be taken from binlogs because of possible slave lags.

            Show
            ip1981 Igor Pashev added a comment - > Timestamp is quite ambiguous when multiple transactions can happen in a millisecond. It should not matter when we use it for a cutoff: if (timestamp > stop_timestamp) stop; (Also "STOP SLAVE AFTER <timestamp>" could be also usable). I'm asking for no new features, just for a convenient way to do what is already possible. The point of this feature is the ability to make dumps of two or more different servers for the given point in time. We could stop masters at the same time, and then make dumps, but this is not an option Thus slaves and stopping replication at the same time, but this time we should be taken from binlogs because of possible slave lags.

              People

              • Assignee:
                Unassigned
                Reporter:
                ip1981 Igor Pashev
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: