Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Add option to enable/disable fsync on commit #15

Open
mdcallag opened this issue Dec 2, 2014 · 0 comments
Open

Add option to enable/disable fsync on commit #15

mdcallag opened this issue Dec 2, 2014 · 0 comments
Assignees

Comments

@mdcallag
Copy link

mdcallag commented Dec 2, 2014

I want the following for RocksDB. This is similar to innodb_flush_log_at_trx_commit which uses an integer set to 0, 1 or 2

  1. A global option (rocksdb_sync_on_commit) to either
    a) disable fsync-on-commit
    b) enable fsync-on-commit
    c) do an fsync for the WAL once per second in the background.

We need a) and b) before doing c) so this can be done in two diffs. Doing c) requires a background thread. See srv_master_thread in innodb source code for tips on doing that -- both thread start and thread stop on db shutdown.

Additionally it would be good to have a per-session variable that can override these values. For the per-session variable see bulk_load in ha_rocksdb.cc at https://github.com/MariaDB/webscalesql-5.6/blob/webscalesql-5.6.19/storage/rocksdb/ha_rocksdb.cc#L128

Whether to sync the RocksDB WAL is specified by the RocksDB user in WriteOptions::sync

@mdcallag mdcallag assigned mdcallag and maykov and unassigned mdcallag Dec 8, 2014
maykov added a commit that referenced this issue Dec 18, 2014
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: #15

Reviewers: mcallaghan, jonah

Subscribers: webscalesql-eng@

Differential Revision: https://phabricator.fb.com/D1745210
maykov added a commit that referenced this issue Dec 18, 2014
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: #15

Reviewers: mcallaghan, jonah

Subscribers: webscalesql-eng@

Differential Revision: https://phabricator.fb.com/D1745210
jonahcohen pushed a commit to MySQLOnRocksDB/mysql-5.6 that referenced this issue Dec 19, 2014
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah

Subscribers: webscalesql-eng@

Differential Revision: https://phabricator.fb.com/D1745210
yoshinorim pushed a commit to yoshinorim/webscalesql-5.6 that referenced this issue Jan 2, 2015
- convert_record_from_storage_format(buf) worked incorrectly
  when buf != table->record[0]. Length bytes were written
  to table->record[0] still.  Moved field->move_field_offset()
  call earlier to prevent that.
- Also, added comments and free() calls to free the retrieved
  blobs (the API is undocumented so we copy what InnoDB does).
maykov added a commit to MySQLOnRocksDB/mysql-5.6 that referenced this issue Jan 16, 2015
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
maykov added a commit to MySQLOnRocksDB/mysql-5.6 that referenced this issue Aug 27, 2015
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah

Subscribers: webscalesql-eng@

Differential Revision: https://phabricator.fb.com/D1745210
maykov added a commit to MySQLOnRocksDB/mysql-5.6 that referenced this issue Aug 27, 2015
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
maykov added a commit to facebook/mysql-5.6 that referenced this issue Sep 14, 2015
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah

Subscribers: webscalesql-eng@

Differential Revision: https://phabricator.fb.com/D1745210
maykov added a commit to facebook/mysql-5.6 that referenced this issue Sep 14, 2015
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
jtolmer pushed a commit to facebook/mysql-5.6 that referenced this issue Jan 5, 2016
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
jtolmer pushed a commit to facebook/mysql-5.6 that referenced this issue Jan 5, 2016
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 7, 2016
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 7, 2016
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 7, 2016
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 7, 2016
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 9, 2016
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 9, 2016
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 9, 2016
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue May 9, 2016
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
hermanlee pushed a commit to facebook/mysql-5.6 that referenced this issue Jan 31, 2017
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
hermanlee pushed a commit to facebook/mysql-5.6 that referenced this issue Jan 31, 2017
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
VitaliyLi pushed a commit to VitaliyLi/mysql-5.6 that referenced this issue Feb 9, 2017
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
VitaliyLi pushed a commit to VitaliyLi/mysql-5.6 that referenced this issue Feb 9, 2017
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 21, 2017
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 21, 2017
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 25, 2017
Summary: Setting WriteOptions through global system variables. The options are read-write. The WriteOptions object is copied for each use to avoid threading issues.

Test Plan:
Ran the test. Observed that sync option turns on and off WAL flushes per transaction (ie SQL statement). Stopped in the gdb and checked that WriteOptions had correct values.

The diff is for this task: MariaDB/webscalesql-5.6#15

Reviewers: mcallaghan, jonah
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 25, 2017
Summary:
Starting a new thread which is used to periodically sync writes.

Changed sysvars to directly mimic WriteOptions. Introduced a separate global sysvar to control the background sync thread.

This diff is for this issue: MariaDB/webscalesql-5.6#15

Test Plan:
ran the test. A number of syncs doesn't go up in the background mode.
It goes up after a second sleep
Checked in gdb that correct write_options are set for truncate table and drop table

Reviewers: jonahcohen, sergey.petrunya.9, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D31221
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants