Details

    • New Feature
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 12.1
    • Backup
    • None
    • Server 12.1 dev sprint

    Description

      The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

      Interface between client and server

      BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

      The ResultSet consists of following fields

      • VARCHAR(N) filename
      • INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
      • BIGINT offset
      • LONGBLOB data

      The client

      There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

      Interface between server and storage engines.

      Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's backup()_begin function. For every file chunk, storage engine calls server's backup_file(filename, flag, offset, length, data) function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

      There default implementation of backup_start() enumerates engines own files, reads them, and signals backup_file() for every chunk read. FLUSH TABLES FOR BACKUP, must be issued for that.

      Engines that support online backup, like Innodb would have much more complicated implementation.

      Incremental and partial backups

      Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

      Backup metadata.

      There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

      Restore

      Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,

      The directory that was made when full backup was stored should be usable for new database.

      files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
      There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.

      Attachments

        Issue Links

          Activity

            wlad Vladislav Vaintroub created issue -
            wlad Vladislav Vaintroub made changes -
            Field Original Value New Value
            Component/s Backup [ 13902 ]
            Fix Version/s 10.4 [ 22408 ]
            wlad Vladislav Vaintroub made changes -
            Description The purpose of this work is to improve current situation around backups by impolementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * BIGINT length
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            wlad Vladislav Vaintroub made changes -
            Description The purpose of this work is to improve current situation around backups by impolementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * BIGINT length
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * BIGINT length
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            wlad Vladislav Vaintroub made changes -
            Description The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * BIGINT length
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            wlad Vladislav Vaintroub made changes -
            Description The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            zhangyuan zhangyuan made changes -
            Attachment xtrabackup.png [ 45264 ]
            zhangyuan zhangyuan added a comment -

            Hi, The attached file is a basic idea of cross-engine backup which we have implemented a year ago.

            zhangyuan zhangyuan added a comment - Hi, The attached file is a basic idea of cross-engine backup which we have implemented a year ago.
            zhangyuan zhangyuan made changes -
            Attachment xtrabackup.png [ 45264 ]
            zhangyuan zhangyuan made changes -
            Attachment xtrabackup.png [ 45265 ]
            zhangyuan zhangyuan made changes -
            Attachment xtrabackup.png [ 45265 ]
            zhangyuan zhangyuan made changes -
            Attachment xtrabackup.png [ 45266 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            julien.fritsch Julien Fritsch made changes -
            Epic Link PT-75 [ 68556 ]
            julien.fritsch Julien Fritsch made changes -
            Epic Link PT-75 [ 68556 ] PT-77 [ 68558 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Rank Ranked higher
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Summary SQL command for BACKUP BACKUP: in-server backup
            ralf.gebhardt Ralf Gebhardt made changes -
            Epic Link PT-77 [ 68558 ] PT-92 [ 69417 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4 [ 22408 ]
            nunop Nuno added a comment -

            This would be VERY great, and would make it more like SQL Server.

            I love the way BACKUP/RESTORE works in SQL Server.

            It would be very nice and convenient if we could do BACKUP/RESTORE for single databases, so I could restore a copy of the database in the same server, to restore data of a column that got messed up, etc...

            Thank you very much for this.

            nunop Nuno added a comment - This would be VERY great, and would make it more like SQL Server. I love the way BACKUP/RESTORE works in SQL Server. It would be very nice and convenient if we could do BACKUP/RESTORE for single databases, so I could restore a copy of the database in the same server, to restore data of a column that got messed up, etc... Thank you very much for this.
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            NRE Projects RM_long_term RM_platform RM_long_term RM_platform RM_105_CANDIDATE
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            danblack Daniel Black added a comment -

            As a within storage engine detail, a linux only function that reduce the contention is to use ioctl_ficlonerange, where available to gain a copy of the key table contents shallowly but immune to changes and release backup locks as soon as possible.

            danblack Daniel Black added a comment - As a within storage engine detail, a linux only function that reduce the contention is to use ioctl_ficlonerange , where available to gain a copy of the key table contents shallowly but immune to changes and release backup locks as soon as possible.
            vlad.lesin Vladislav Lesin made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 84950 ] MariaDB v4 [ 130766 ]
            marko Marko Mäkelä added a comment - - edited

            Server-side backup will prevent errors like MDEV-21255 or MDEV-27551 from occurring, because the server can simply replicate its write-ahead log to the backup stream, and the server knows when it is deleting or renaming files. If needed, the throughput of any write workload that the server is concurrently handling would slow down.

            Some years ago, I thought that the most straightforward implementation of a server-side InnoDB backup would be to (re)write changed pages from the buffer pool to a result set stream.

            • Advantage: Whatever tool restores the stream can simply restore all data files directly.
            • Disadvantage: The stream basically becomes a log that stores full page images even for tiny changes (such as updating one byte on the page).

            With MDEV-12353 and MDEV-14425, I think that the best format for streaming InnoDB changes would be the InnoDB log file. The server-side backup could dump InnoDB data file images as well as an append-only copy of the server’s log, written as an ib_logfile0 that can be applied by the recipient. This log file would have similar format as the one that is currently created by mariadb-backup --backup.

            For incremental backups, it could be easiest to implement redo log archiving, say, by duplicating the circular ib_logfile0 with append-only file(s) that might be named ib_logfile.%llu and start at the LSN identified in the header or in the file name. An incremental backup client would request all log from the LSN where it last left off, and the server would either say "sorry, our log is not that old" or construct a corresponding log file (starting with an archived log file that is at least as old as that LSN). In the MDEV-14425 format, cutting some LSN from the beginning of an append-only log file is trivial: just rewrite the header so that the log payload area starts at the desired LSN, and then copy everything starting from the byte offset that represents that LSN.

            marko Marko Mäkelä added a comment - - edited Server-side backup will prevent errors like MDEV-21255 or MDEV-27551 from occurring, because the server can simply replicate its write-ahead log to the backup stream, and the server knows when it is deleting or renaming files. If needed, the throughput of any write workload that the server is concurrently handling would slow down. Some years ago, I thought that the most straightforward implementation of a server-side InnoDB backup would be to (re)write changed pages from the buffer pool to a result set stream. Advantage: Whatever tool restores the stream can simply restore all data files directly. Disadvantage: The stream basically becomes a log that stores full page images even for tiny changes (such as updating one byte on the page). With MDEV-12353 and MDEV-14425 , I think that the best format for streaming InnoDB changes would be the InnoDB log file. The server-side backup could dump InnoDB data file images as well as an append-only copy of the server’s log, written as an ib_logfile0 that can be applied by the recipient. This log file would have similar format as the one that is currently created by mariadb-backup --backup . For incremental backups, it could be easiest to implement redo log archiving, say, by duplicating the circular ib_logfile0 with append-only file(s) that might be named ib_logfile.%llu and start at the LSN identified in the header or in the file name. An incremental backup client would request all log from the LSN where it last left off, and the server would either say "sorry, our log is not that old" or construct a corresponding log file (starting with an archived log file that is at least as old as that LSN). In the MDEV-14425 format, cutting some LSN from the beginning of an append-only log file is trivial: just rewrite the header so that the log payload area starts at the desired LSN, and then copy everything starting from the byte offset that represents that LSN.
            marko Marko Mäkelä made changes -

            The suggested "Interface between client and server" would basically replace the internal datasink.h interface that is being used in mariadb-backup, and it would be similar to the datasink_xbstream implementation.

            For InnoDB, the server-side backup would have the benefit that of using the buffer pool as a cache. Asynchronous read-ahead can load pages to the buffer pool.

            The algorithm for a full backup could be as follows:

            1. Initiate a log checkpoint and start streaming log log records directly from log_sys.buf.
            2. Enumerate all persistent tablespaces. (They may be dropped at any time because we are not holding locks; we must prevent bugs like MDEV-27551.)
            3. For each tablespace that we found, acquire U-lock on every page (based on the current size of the tablespace) and dump it to the stream.
              • Skip any pages that do not exist in the buffer pool and are marked as free in the allocation bitmap page.
              • If a page that we read to the buffer pool is corrupted, issue an error message, and skip the page. (Backup must not cause a server crash like MDEV-13542.)
              • Skip any pages that are marked as free in the page descriptor, similar to MDEV-15528.
              • Skip any pages that are marked as newly initialized in the page descriptor. They will be covered by the redo log, similar to MDEV-19738.
              • If access_time==0 && oldest_modification() <= 1, the page must have been only accessed due to backup, and we might want to evict it from the buffer pool, to reduce cache pollution.
              • Switch to the next tablespace if the tablespace was flagged for deletion.

            Observations:

            • If files were deleted during the backup, the stream may contain some ‘garbage’ pages belonging to deleted files, as well as FILE_DELETE records in the copied log.
            • If files were renamed during the backup, the stream would contain the original file names, as well as FILE_RENAME records in the copied log.
            • If files were created during the backup, all changes will be covered by the copied log; see MDEV-24626.
            • If files were extended during the backup, in the copied log there will be records to update the FSP_SIZE and to initialize any added pages.
            • If any pages were modified after they were copied, in the copied log there will be records to cover those updates.

            For incremental backups, my best idea remains that the log be archived on the server along with a log of all checkpoints. We would simply stream the log from the latest checkpoint that is at or before the requested LSN. We would probably have to keep a directory of checkpoint LSNs in the archived log, because the log header only stores the 2 latest ones. A simple way could be to switch to a new archived log file on every checkpoint. The checkpoint LSN of the archived log could be available in the file name.

            All functionality of mariadb-backup --prepare would have to be integrated in the normal InnoDB startup.

            marko Marko Mäkelä added a comment - The suggested "Interface between client and server" would basically replace the internal datasink.h interface that is being used in mariadb-backup , and it would be similar to the datasink_xbstream implementation. For InnoDB, the server-side backup would have the benefit that of using the buffer pool as a cache. Asynchronous read-ahead can load pages to the buffer pool. The algorithm for a full backup could be as follows: Initiate a log checkpoint and start streaming log log records directly from log_sys.buf . Enumerate all persistent tablespaces. (They may be dropped at any time because we are not holding locks; we must prevent bugs like MDEV-27551 .) For each tablespace that we found, acquire U-lock on every page (based on the current size of the tablespace) and dump it to the stream. Skip any pages that do not exist in the buffer pool and are marked as free in the allocation bitmap page. If a page that we read to the buffer pool is corrupted, issue an error message, and skip the page. (Backup must not cause a server crash like MDEV-13542 .) Skip any pages that are marked as free in the page descriptor, similar to MDEV-15528 . Skip any pages that are marked as newly initialized in the page descriptor. They will be covered by the redo log, similar to MDEV-19738 . If access_time==0 && oldest_modification() <= 1 , the page must have been only accessed due to backup, and we might want to evict it from the buffer pool, to reduce cache pollution. Switch to the next tablespace if the tablespace was flagged for deletion. Observations: If files were deleted during the backup, the stream may contain some ‘garbage’ pages belonging to deleted files, as well as FILE_DELETE records in the copied log. If files were renamed during the backup, the stream would contain the original file names, as well as FILE_RENAME records in the copied log. If files were created during the backup, all changes will be covered by the copied log; see MDEV-24626 . If files were extended during the backup, in the copied log there will be records to update the FSP_SIZE and to initialize any added pages. If any pages were modified after they were copied, in the copied log there will be records to cover those updates. For incremental backups, my best idea remains that the log be archived on the server along with a log of all checkpoints. We would simply stream the log from the latest checkpoint that is at or before the requested LSN. We would probably have to keep a directory of checkpoint LSNs in the archived log, because the log header only stores the 2 latest ones. A simple way could be to switch to a new archived log file on every checkpoint. The checkpoint LSN of the archived log could be available in the file name. All functionality of mariadb-backup --prepare would have to be integrated in the normal InnoDB startup.
            marko Marko Mäkelä made changes -

            Bugs like MDEV-27424 would be impossible, or they would affect the server and backup alike, if all pages for the backup were read from the server’s buffer pool. There would be no race condition between two processes reading and writing files concurrently, and no need to re-read corrupted-looking pages because of that.

            marko Marko Mäkelä added a comment - Bugs like MDEV-27424 would be impossible, or they would affect the server and backup alike, if all pages for the backup were read from the server’s buffer pool. There would be no race condition between two processes reading and writing files concurrently, and no need to re-read corrupted-looking pages because of that.
            marko Marko Mäkelä added a comment - - edited

            MDEV-27621 is a case where backup cannot keep up with the server that is writing log. If the server process itself streamed the log like proposed in this task, it could trivially slow down the write workload as necessary.

            marko Marko Mäkelä added a comment - - edited MDEV-27621 is a case where backup cannot keep up with the server that is writing log. If the server process itself streamed the log like proposed in this task, it could trivially slow down the write workload as necessary.
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            markus makela markus makela made changes -
            markus makela markus makela made changes -
            toddstoffel Todd Stoffel (Inactive) made changes -
            marko Marko Mäkelä made changes -

            marko not sure it is a good idea for a strained backup to slow down the server to accommodate its needs. We want backup to be as less impactful as we can and this idea goes in the opposite direction.

            rpizzi Rick Pizzi (Inactive) added a comment - marko not sure it is a good idea for a strained backup to slow down the server to accommodate its needs. We want backup to be as less impactful as we can and this idea goes in the opposite direction.

            The DS_TYPE_LOCAL interface of mariadb-backup could be demoted to a fallback of something that would invoke the Linux system call copy_file_range. That function call would not only allow files to be copied with less context switching, but also allow instantaneous ‘copying’ on file systems that support snapshots via copy-on-write (such as xfs and btrfs).

            Similarly, the DS_TYPE_STDOUT interface could be demoted to a fallback of the Linux system call splice or the nonstandard but widely implemented system call sendfile.

            marko Marko Mäkelä added a comment - The DS_TYPE_LOCAL interface of mariadb-backup could be demoted to a fallback of something that would invoke the Linux system call copy_file_range . That function call would not only allow files to be copied with less context switching, but also allow instantaneous ‘copying’ on file systems that support snapshots via copy-on-write (such as xfs and btrfs ). Similarly, the DS_TYPE_STDOUT interface could be demoted to a fallback of the Linux system call splice or the nonstandard but widely implemented system call sendfile .

            rpizzi, the "redo log archiving" feature of MySQL 8.0 implements the idea of server-assisted copying of the log in a restricted form: writing a copy of the log to a file system that is directly accessible at the server.

            What would you choose if the choices are the following?

            1. Some slowdown of the server during backup (because the server would be responsible for replicating the log)
            2. Extreme I/O load during backup (MDEV-28772), or context switching load on the kernel (inter-process communication via the file system)
            3. A failed backup (MDEV-27621)
            marko Marko Mäkelä added a comment - rpizzi , the "redo log archiving" feature of MySQL 8.0 implements the idea of server-assisted copying of the log in a restricted form: writing a copy of the log to a file system that is directly accessible at the server. What would you choose if the choices are the following? Some slowdown of the server during backup (because the server would be responsible for replicating the log) Extreme I/O load during backup ( MDEV-28772 ), or context switching load on the kernel (inter-process communication via the file system) A failed backup ( MDEV-27621 )

            If there are enough resources I would go with #2 .
            Obviously the issue is when there are not enough resources for both the workload AND the backup.
            In this situation we want the workload to take precedence but we also want the backup to complete, albeit
            taking longer if there is resource starvation.

            rpizzi Rick Pizzi (Inactive) added a comment - If there are enough resources I would go with #2 . Obviously the issue is when there are not enough resources for both the workload AND the backup. In this situation we want the workload to take precedence but we also want the backup to complete, albeit taking longer if there is resource starvation.

            marko reading the blog article I am somewhat puzzled - an heavily used system will already write redo logs at a very high pace, do we (does LeFred) really think that it's a good idea to duplicate that heavy I/O in these circumstances??

            To avoid redo logs overrun it should be sufficient to make them large enough.

            rpizzi Rick Pizzi (Inactive) added a comment - marko reading the blog article I am somewhat puzzled - an heavily used system will already write redo logs at a very high pace, do we (does LeFred) really think that it's a good idea to duplicate that heavy I/O in these circumstances?? To avoid redo logs overrun it should be sufficient to make them large enough.

            Marko, both 1 and 2 seem like good ideas, perhaps configurable with a variable such as innodb_log_file_backup_method.

            manjot Manjot Singh (Inactive) added a comment - Marko, both 1 and 2 seem like good ideas, perhaps configurable with a variable such as innodb_log_file_backup_method.

            +1 for Manjot request. Among other motivations, xfs snapshots can be problematic, as they freeze IO.

            f_razzoli Federico Razzoli added a comment - +1 for Manjot request. Among other motivations, xfs snapshots can be problematic, as they freeze IO.
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            AirFocus AirFocus made changes -
            Description The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server
            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields
            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.
            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.
            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,
             
            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server

            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields

            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.

            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup\_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client\-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.

            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi\-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,

            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            julien.fritsch Julien Fritsch made changes -
            Description The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server

            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields

            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.

            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup\_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client\-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.

            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi\-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,

            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            The purpose of this work is to improve current situation around backups by implementing a SQL BACKUP command.

            h1. Interface between client and server

            BACKUP command sends the file segments to the client via MySQL's protocol ResultSet, i.e client issues BACKUP statement, server sends a result set back

            The ResultSet consists of following fields

            * VARCHAR(N) filename
            * INT(SET?) flags (OPEN,CLOSE, SPARSE, RENAME, DELETE, etc)
            * BIGINT offset
            * LONGBLOB data

            h2.The client
            There will be a simple client program which will issue "BACKUP" statement ,read the result set from server, and apply it to create a directory with a copy of the database. Due to abiliity to use client API (in C, .NET, Java, etc), it should be relatively easy to write specialized backup applications for special needs (e.g "streaming to clould", distributing to multiple machines)

            h1. Interface between server and storage engines.

            Most of the actual work is done by the storage engines, server initiates backup by calling storage engine's _backup()_begin_ function. For every file chunk, storage engine calls server's _backup_file(filename, flag, offset, length, data)_ function, that streams file chink as result set row to client. When backup is finished, engine calls `backup_end()` so that server would know when backup is finally done.

            There default implementation of _backup_start()_ enumerates engines own files, reads them, and signals _backup_file()_ for every chunk read. _FLUSH TABLES FOR BACKUP_, must be issued for that.

            Engines that support online backup, like Innodb would have much more complicated implementation.

            h1.Incremental and partial backups
            Incremental/differential (changes since specific backup) and partial backups( only some tables) will be supported as well, and the client\-server interface does not change much for that . For incremental backup, the client application might need to invent some "patch" format, or use some standard for binary diffs (rdiff? bsdiff? xdelta? ), and save diffs to be applied to "base backup" directory later.

            h1. Backup metadata.

            There is a need to store different kind of metadata in the backup, usually binlog position, and some kind of timestamp (LSN) for incremental backup. This information can be stored as session variable available after BACKUP command, or send as extra result set after the backup one (protocol does support multi\-result sets).

            h1. Restore

            Unlike the current solution with mariabackup or xtrabackup, there won't be any kinds of "prepare" or "restore" application,

            The directory that was made when full backup was stored should be usable for new database.

            files from partial backups could just be copied to destination (and maybe "IMPORT TABLESPACE", if we still support that).
             There should still be some kind of "patch" application for applying incremental backups to the base directory. Dependend on how our client stores incremental backup, we can do without it , and users would only need to use 3rd party bsdiff, rdiff,, mspatcha.
            marko Marko Mäkelä made changes -
            maxmether Max Mether made changes -
            Assignee Marko Mäkelä [ marko ]
            ralf.gebhardt Ralf Gebhardt made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.3 [ 28565 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.2 [ 28603 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.3 [ 28565 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.3 [ 28565 ]

            I believe that a reasonable subgoal of this task would be to remove the need to execute mariadb-backup --prepare, that is, try to make it so that the server can be started directly on backed-up files. With the InnoDB log file format change of MDEV-14425, that should be even easier:

            1. Incremental backups can be restored by treating the initial ib_logfile0 from the full backup and the incremental snippets as if they had been concatenated together.
              • In the MDEV-14425 format, the size of an InnoDB log block is mini-transaction; there is no padding to any 512-byte log blocks anymore.
              • As an option, incremental backup could simply append new log records to the ib_logfile0 that was updated by the last incremental or full backup.
            2. Some adjustment due to MDEV-18184 will be needed.
              • Maybe, conduct some performance tests to verify if the ‘optimization’ is useful at all? A server-side backup can avoid copying newly initialized data files altogether!
              • The server could look for a backup metadata file and validate its contents, like mariadb-backup --prepare currently does.
            marko Marko Mäkelä added a comment - I believe that a reasonable subgoal of this task would be to remove the need to execute mariadb-backup --prepare , that is, try to make it so that the server can be started directly on backed-up files. With the InnoDB log file format change of MDEV-14425 , that should be even easier: Incremental backups can be restored by treating the initial ib_logfile0 from the full backup and the incremental snippets as if they had been concatenated together. In the MDEV-14425 format, the size of an InnoDB log block is mini-transaction; there is no padding to any 512-byte log blocks anymore. As an option, incremental backup could simply append new log records to the ib_logfile0 that was updated by the last incremental or full backup. Some adjustment due to MDEV-18184 will be needed. Maybe, conduct some performance tests to verify if the ‘optimization’ is useful at all? A server-side backup can avoid copying newly initialized data files altogether! The server could look for a backup metadata file and validate its contents, like mariadb-backup --prepare currently does.

            I forgot that there are two usage scenarios of incremental backup:

            • With no gaps in the redo log: If writes are seldom, or we implemented and enabled log archiving on the server, we can simply copy and apply the additional section of the log.
            • If the log from the last backup LSN is missing, we must copy all data files that were changed since the last backup (based on the FIL_PAGE_LSN of each page).

            In the latter case, the additional preparation might be too complex to be implemented as part of the normal crash recovery.

            marko Marko Mäkelä added a comment - I forgot that there are two usage scenarios of incremental backup: With no gaps in the redo log: If writes are seldom, or we implemented and enabled log archiving on the server, we can simply copy and apply the additional section of the log. If the log from the last backup LSN is missing, we must copy all data files that were changed since the last backup (based on the FIL_PAGE_LSN of each page). In the latter case, the additional preparation might be too complex to be implemented as part of the normal crash recovery.
            serg Sergei Golubchik made changes -
            Fix Version/s 11.2 [ 28603 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.3 [ 28565 ]
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            Issue Type Task [ 3 ] New Feature [ 2 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.7 [ 29815 ]
            marko Marko Mäkelä added a comment - - edited

            There is a Linux system call ioctl(FICLONE) (applicable to XFS, btrfs, bcachefs) as well as macOS fclonefileat() (APFS) and something for the Microsoft Windows ReFS that would allow more efficient copying of files, similar to GNU cp --reflink=auto. I think that we should consider an option to employ that for copying most files. MyRocks backups are probably best served by regular hard links.

            Edit: MDEV-23947 has been filed for this idea.

            marko Marko Mäkelä added a comment - - edited There is a Linux system call ioctl(FICLONE) (applicable to XFS, btrfs, bcachefs) as well as macOS fclonefileat() (APFS) and something for the Microsoft Windows ReFS that would allow more efficient copying of files, similar to GNU cp --reflink=auto . I think that we should consider an option to employ that for copying most files. MyRocks backups are probably best served by regular hard links. Edit: MDEV-23947 has been filed for this idea.

            I think that we need to implement some prototype of this, or MDEV-21105 (or MDEV-7502).

            marko Marko Mäkelä added a comment - I think that we need to implement some prototype of this, or MDEV-21105 (or MDEV-7502 ).
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Debarun Banerjee [ JIRAUSER54513 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.8 [ 29921 ]
            Fix Version/s 11.7 [ 29815 ]
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 11.9 [ 29945 ]
            Fix Version/s 11.8 [ 29921 ]
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 12.1 [ 29992 ]
            Fix Version/s 12.0 [ 29945 ]
            julien.fritsch Julien Fritsch made changes -
            Sprint Server 12.1 dev sprint [ 793 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -

            People

              debarun Debarun Banerjee
              wlad Vladislav Vaintroub
              Votes:
              16 Vote for this issue
              Watchers:
              37 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.