Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2831

Skip creating a checkpoint if there have been no changes

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.9.0, 3.2.11, 3.4.0-rc1
    • Labels:
      None
    • # Replies:
      8
    • Last comment by Customer:
      true

      Description

      At the moment we always review all handles when a checkpoint is started. That can be disruptive if there are a lot of tables, and is not necessary for read-only workloads. We could skip the handle gathering phase if we knew that there haven't been changes since the last checkpoint.

      The mechanism Could be:

      • The connection is marked as clean on open.
      • The connection is marked as clean as soon as the transaction ID is allocated for a checkpoint.
      • If the checkpoint fails with an error the connection is marked as dirty.
      • Any time a btree is currently marked as dirty the connection is also marked as dirty.

      Once those markers are in place a full non-forced checkpoint could skip creating a new checkpoint if the connection is clean.

      It'd also be worthwhile to add assertions to validate the scheme. Maybe sweep could ensure that the connection is dirty any time it encounters a dirty btree handle.

      1. graph.png
        546 kB

        Issue Links

          Activity

          Hide
          sulabh.mahajan Sulabh Mahajan added a comment -

          Attached graph shows the performance improvement we get with the fix. The series in black colour is after the fix vs red in before the fix.
          The graph plots maximum read latencies over the run duration. The extreme peaks for the red series corresponds to the checkpoints, which is missing in the black series. The workload is readonly over 5000 collections, with connection configuration asking for checkpoints to run every 20 secs.
          Timeseries data for the black series run show that the checkpoints get skipped for the readonly workloads.

          Show
          sulabh.mahajan Sulabh Mahajan added a comment - Attached graph shows the performance improvement we get with the fix. The series in black colour is after the fix vs red in before the fix. The graph plots maximum read latencies over the run duration. The extreme peaks for the red series corresponds to the checkpoints, which is missing in the black series. The workload is readonly over 5000 collections, with connection configuration asking for checkpoints to run every 20 secs. Timeseries data for the black series run show that the checkpoints get skipped for the readonly workloads.
          Hide
          sulabh.mahajan Sulabh Mahajan added a comment - - edited

          Following is the wtperf configuration used for testing:

          conn_config="cache_size=2GB,eviction=(threads_max=4),log=(enabled=false),statistics=(fast),statistics_log=(json=1,wait=1),checkpoint=(wait=20,log_size=500MB)"
          table_config="leaf_page_max=32k,internal_page_max=16k,allocation_size=4k,split_pct=90,type=file"
          icount=50000000
          #Create database for the first time, be setting to true
          #create=true
          #Set to false for subsequent readonly runs
          create=false
          compression="snappy"
          #Add forced checkpoints
          #checkpoint_interval=90
          #checkpoint_threads=1
          populate_threads=10
          report_interval=1
          run_time=900
          sample_interval=1
          sample_rate=1
          max_latency=100000
          table_count=5000
          threads=((count=5,reads=1))
          value_sz=1000
          

          Show
          sulabh.mahajan Sulabh Mahajan added a comment - - edited Following is the wtperf configuration used for testing: conn_config="cache_size=2GB,eviction=(threads_max=4),log=(enabled=false),statistics=(fast),statistics_log=(json=1,wait=1),checkpoint=(wait=20,log_size=500MB)" table_config="leaf_page_max=32k,internal_page_max=16k,allocation_size=4k,split_pct=90,type=file" icount=50000000 #Create database for the first time, be setting to true #create=true #Set to false for subsequent readonly runs create=false compression="snappy" #Add forced checkpoints #checkpoint_interval=90 #checkpoint_threads=1 populate_threads=10 report_interval=1 run_time=900 sample_interval=1 sample_rate=1 max_latency=100000 table_count=5000 threads=((count=5,reads=1)) value_sz=1000
          Hide
          sulabh.mahajan Sulabh Mahajan added a comment -

          Perf Stress tests did not show any regression.

          Show
          sulabh.mahajan Sulabh Mahajan added a comment - Perf Stress tests did not show any regression.
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'}

          Message: WT-2831 Skip checkpointing if there have been no modifications (#3067)

          This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables.
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'} Message: WT-2831 Skip checkpointing if there have been no modifications (#3067) This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables. Branch: develop https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'}

          Message: WT-2831 Skip checkpointing if there have been no modifications (#3067)

          This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables.
          Branch: mongodb-3.4
          https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'} Message: WT-2831 Skip checkpointing if there have been no modifications (#3067) This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables. Branch: mongodb-3.4 https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'}

          Message: Import wiredtiger: 6a31c2118cce88c68281eda2ca9ab1df915a2773 from branch mongodb-3.4

          ref: fc0e7abe82..6a31c2118c
          for: 3.4.0

          WT-2831 Skip creating a checkpoint if there have been no changes
          WT-2858 rename wtperf's CONFIG structure
          WT-2895 Reduce the runtime of make check testing with disable long
          WT-2907 Bug in Java ConcurrentCloseTest case
          WT-2917 split wtperf's configuration into per-database and per-run parts
          WT-2920 New eviction statistics
          WT-2931 Configure default in-memory dirty cache usage lower
          WT-2932 Allow applications to selectively ignore cache limit with in-memory configuration
          WT-2933 Fix a race between named snapshots and checkpoints
          WT-2937 test_inmem01 aborts due to stuck cache
          WT-2938 Assembly files should end in .sx, not .S
          WT-2941 Improve test/format to use faster key-generation functions
          WT-2942 verbose strings don't need newline
          WT-2946 dist/s_docs incompatible with OS X Xcode installation
          WT-2948 simplify error handling by making epoch time return never fail
          WT-2950 Inserting multi-megabyte values can cause large in-memory pages
          Branch: master
          https://github.com/mongodb/mongo/commit/448f5b43d249dd090da1d79b82c9ab1b742e4f38

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'} Message: Import wiredtiger: 6a31c2118cce88c68281eda2ca9ab1df915a2773 from branch mongodb-3.4 ref: fc0e7abe82..6a31c2118c for: 3.4.0 WT-2831 Skip creating a checkpoint if there have been no changes WT-2858 rename wtperf's CONFIG structure WT-2895 Reduce the runtime of make check testing with disable long WT-2907 Bug in Java ConcurrentCloseTest case WT-2917 split wtperf's configuration into per-database and per-run parts WT-2920 New eviction statistics WT-2931 Configure default in-memory dirty cache usage lower WT-2932 Allow applications to selectively ignore cache limit with in-memory configuration WT-2933 Fix a race between named snapshots and checkpoints WT-2937 test_inmem01 aborts due to stuck cache WT-2938 Assembly files should end in .sx, not .S WT-2941 Improve test/format to use faster key-generation functions WT-2942 verbose strings don't need newline WT-2946 dist/s_docs incompatible with OS X Xcode installation WT-2948 simplify error handling by making epoch time return never fail WT-2950 Inserting multi-megabyte values can cause large in-memory pages Branch: master https://github.com/mongodb/mongo/commit/448f5b43d249dd090da1d79b82c9ab1b742e4f38
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'}

          Message: WT-2831 Skip checkpointing if there have been no modifications (#3067)

          This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables.
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'sulabhM', u'name': u'Sulabh Mahajan', u'email': u'sulabh.mahajan@mongodb.com'} Message: WT-2831 Skip checkpointing if there have been no modifications (#3067) This saves locking and scanning the list of active handles for read-only workloads, which can be time consuming when there are many tables. Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'}

          Message: Import wiredtiger: b11ed312cedb905dec49dd2c9c262fabf64d13cd from branch mongodb-3.2

          ref: 9cf2f89d6d..b11ed312ce
          for: 3.2.11

          WT-1592 Dump detailed cache information via statistics
          WT-2403 Enhance random cursor implementation for LSM trees
          WT-2831 Skip creating a checkpoint if there have been no changes
          WT-2858 rename wtperf's CONFIG structure
          WT-2880 Add support for Zstandard compression
          WT-2895 Reduce the runtime of make check testing with disable long
          WT-2904 Fix a bug where the reported checkpoint size could be many times data size
          WT-2907 Bug in Java ConcurrentCloseTest case
          WT-2917 split wtperf's configuration into per-database and per-run parts
          WT-2920 Add statistic tracking application thread cache maintenance time
          WT-2931 Configure default in-memory dirty cache usage lower
          WT-2932 Allow applications to selectively ignore cache limit with in-memory configuration
          WT-2933 Fix a race between named snapshots and checkpoints
          WT-2937 test_inmem01 aborts due to stuck cache
          WT-2938 Assembly files should end in .sx, not .S
          WT-2941 Improve test/format to use faster key-generation functions
          WT-2942 verbose strings don't need newline
          WT-2946 dist/s_docs incompatible with OS X Xcode installation
          WT-2948 simplify error handling by making epoch time return never fail
          WT-2949 Add an option to wtperf to not close connection on shutdown
          WT-2950 Inserting multi-megabyte values can cause large in-memory pages
          WT-2954 Inserting multi-megabyte values can cause large in-memory pages
          WT-2955 Add statistics tracking the amount of time threads spend waiting for high level locks
          WT-2956 utility tests -h option is always overridden by the default setup
          WT-2959 Ensure WT_SESSION_IMPL is never used before it's initialized
          WT-2963 Race setting max_entries during eviction
          WT-2965 test_wt2323_join_visibility can hang on OSX
          WT-2974 lint
          WT-2976 Add a statistic tracking how long application threads spend doing I/O
          WT-2977 Csuite LSM Random test can occasionally fail
          WT-2985 Race during checkpoint can cause a core dump
          WT-2987 Fix a bug where opening a cursor on an incomplete table drops core
          WT-2988 __wt_epoch potentially returns garbage values.
          Branch: v3.2
          https://github.com/mongodb/mongo/commit/ebbb4eb0b091fa185b06a060d24b68eb6761ba4a

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'} Message: Import wiredtiger: b11ed312cedb905dec49dd2c9c262fabf64d13cd from branch mongodb-3.2 ref: 9cf2f89d6d..b11ed312ce for: 3.2.11 WT-1592 Dump detailed cache information via statistics WT-2403 Enhance random cursor implementation for LSM trees WT-2831 Skip creating a checkpoint if there have been no changes WT-2858 rename wtperf's CONFIG structure WT-2880 Add support for Zstandard compression WT-2895 Reduce the runtime of make check testing with disable long WT-2904 Fix a bug where the reported checkpoint size could be many times data size WT-2907 Bug in Java ConcurrentCloseTest case WT-2917 split wtperf's configuration into per-database and per-run parts WT-2920 Add statistic tracking application thread cache maintenance time WT-2931 Configure default in-memory dirty cache usage lower WT-2932 Allow applications to selectively ignore cache limit with in-memory configuration WT-2933 Fix a race between named snapshots and checkpoints WT-2937 test_inmem01 aborts due to stuck cache WT-2938 Assembly files should end in .sx, not .S WT-2941 Improve test/format to use faster key-generation functions WT-2942 verbose strings don't need newline WT-2946 dist/s_docs incompatible with OS X Xcode installation WT-2948 simplify error handling by making epoch time return never fail WT-2949 Add an option to wtperf to not close connection on shutdown WT-2950 Inserting multi-megabyte values can cause large in-memory pages WT-2954 Inserting multi-megabyte values can cause large in-memory pages WT-2955 Add statistics tracking the amount of time threads spend waiting for high level locks WT-2956 utility tests -h option is always overridden by the default setup WT-2959 Ensure WT_SESSION_IMPL is never used before it's initialized WT-2963 Race setting max_entries during eviction WT-2965 test_wt2323_join_visibility can hang on OSX WT-2974 lint WT-2976 Add a statistic tracking how long application threads spend doing I/O WT-2977 Csuite LSM Random test can occasionally fail WT-2985 Race during checkpoint can cause a core dump WT-2987 Fix a bug where opening a cursor on an incomplete table drops core WT-2988 __wt_epoch potentially returns garbage values. Branch: v3.2 https://github.com/mongodb/mongo/commit/ebbb4eb0b091fa185b06a060d24b68eb6761ba4a

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                26 weeks, 4 days ago
                Date of 1st Reply: