Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-5425

MyRocks - WAL is not archived unless rocksdb_wal_ttl_seconds is set to non-zero value

    Details

    • Type: Improvement
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Not 5.6, 5.7.25-28, 8.0.13-4
    • Fix Version/s: None
    • Component/s: Documentation, MyRocks
    • Labels:
    • Environment:

      Description

      Per the documentation found here....

      https://www.percona.com/doc/percona-server/5.7/myrocks/variables.html#rocksdb_wal_ttl_seconds

      The rocksdb_wal_ttl_seconds variable is defined as....

      Specifies the timeout in seconds before deleting archived WAL files

      I checked my MyRocks data directory to check for archived WAL files to see when they would be purged, but I didn't find any as they weren't being created.

      mysql> show global variables like 'rocksdb_wal_ttl_seconds';
      +-------------------------+-------+
      | Variable_name           | Value |
      +-------------------------+-------+
      | rocksdb_wal_ttl_seconds | 0     |
      +-------------------------+-------+
      1 row in set (0.00 sec)mysql> exit
      Bye
      [root@centos7-1 .rocksdb]# ls -lh ./archive/
      total 0
      [root@centos7-1 .rocksdb]#
      

      I tried various tests to see what would cause archiving, but it wasn't until I set rocksdb_wal_ttl_seconds to a non-zero value that WALs got archived.

      mysql> show global variables like 'rocksdb_wal_ttl_seconds';
      +-------------------------+-------+
      | Variable_name           | Value |
      +-------------------------+-------+
      | rocksdb_wal_ttl_seconds | 300   |
      +-------------------------+-------+
      1 row in set (0.00 sec)mysql> show global variables like '%archive%';
      Empty set (0.00 sec)mysql> exit
      Bye
      [root@centos7-1 .rocksdb]# ls -lh *.log; ls -lh ./archive/
      -rw-r----- 1 mysql mysql 117 Jan 15 10:41 001911.log
      -rw-r----- 1 mysql mysql  74 Jan 15 10:41 001917.log
      total 0
      [root@centos7-1 .rocksdb]# #started write
      [root@centos7-1 .rocksdb]# ls -lh *.log; ls -lh ./archive/
      -rw-r----- 1 mysql mysql  117 Jan 15 10:41 001911.log
      -rw-r----- 1 mysql mysql 3.1M Jan 15 10:42 001917.log
      total 0
      ...
      [root@centos7-1 .rocksdb]# ls -lh *.log; ls -lh ./archive/
      -rw-r----- 1 mysql mysql  117 Jan 15 10:41 001911.log
      -rw-r----- 1 mysql mysql 3.4M Jan 15 10:43 001935.log
      total 33M
      -rw-r----- 1 mysql mysql 17M Jan 15 10:42 001917.log
      -rw-r----- 1 mysql mysql 17M Jan 15 10:43 001931.log

      In conclusion, I don't think there is anything wrong with the code, and using a variable to enable archiving makes sense to me, but the documentation is ambiguous as to how archiving would be enabled and disabled. I believe that the documentation should be revised to not that archiving will not occur until rocksdb_wal_ttl_seconds is set to a non-zero value

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                patrick.birch Patrick Birch
                Reporter:
                Sylvester Peter Sylvester
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: