google-cloud-platformgoogle-cloud-spanner

Why do I see a dip in GCP Spanner 'Total storage' graph?


We have been using Spanner and recently noticed a dip in the 'Total storage' graph in 'System insights' which is not expected and we would like to know what are the possible causes for the storage to get reduced and then rise up again. There have been no action taken from our end which would cause the storage to reduce and then rise up again.

enter image description here Thanks!

In Spanner > System insights the 'Total storage' graph shows a dip which should not have been there. There should have been only increased usage pattern.


Solution

  • These effects are due to Spanner's support for multi-version storage. All erased or overwritten data is retained in storage thanks to multi-version storage.

    This is already discussed in public document:

    These effects stem from Spanner's support for multi-version storage. Multi-version storage keeps all deleted or overwritten data in-storage and available for a limited time to enable features that let you read previous data values, such as stale reads and point-in-time recovery. Performing a large data deletion doesn't immediately get reflected in your database's storage metrics. Similarly, an apparently unprompted drop in a database's total size likely means that Spanner's regular data-compaction process recently cleaned up a large set of data that was deleted or overwritten as far back as several days ago.