Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Datastore integration #40

Merged
merged 8 commits into from
Jul 25, 2019
Merged

Conversation

nblair
Copy link
Contributor

@nblair nblair commented Jul 11, 2019

This pull request is a significant refactor in how this plugin manages Blobstore metadata:

  • the index of soft-deleted blobs, and
  • the total size and count of all blobs persisted in the blobstore.

What's included:

  • The DeletedBlobIndex now nests its entries in a new key hierarchy. This addresses a design flaw in previous releases that offered no separation of data between multiple Google Cloud Blobstore instances in one Repository Manager deployment.
  • ShardedCounterMetricsStore is a new way to calculate the total size and count of all blobs in the blobstore. It replaces the metrics-[nodeid].properties file approach.
  • A new Health Check is added to the plugin to raise an alert to administrators if the size of the index of soft-deleted blobs passes a threshold; this alert includes a nudge to setup a Blobstore Compaction task.
  • Blobstore#remove() previously was a no-op; it now will delete all blobstore metadata in datastore when invoked. It still does not delete the Storage bucket nor any files within the bucket.

There is a lot of change in this set; I've included an ADR to cover most of it, I recommend starting there.

Previously, the DeletedBlobIndex stored the ids of soft-deleted blobs in the root namespace in Google Cloud Datastore.

After this change set, the ids are stored in a new hierarchy that is friendlier for a) multiple google cloud blobstore instances in the same project and b) will support us using Datastore for other blobstore metadata.

Also included is further expansion of the HealthCheck - it can now indicate that a google cloud blobstore has a high number of soft-deleted blobs in need of compaction.
The previous metrics store inherited functionality to integrate with BlobStore soft-quotas. The new metrics store does not inherit this, so this change set merges that functionality into the BlobStore implementation.

This changeset also includes Datastore transactions around the read and write operations.
Also made the flush frequency a constant for better visibility.
@nblair
Copy link
Contributor Author

nblair commented Jul 25, 2019

PR opened here for visibility, proceeding with the merge as there are continued efforts that will build on this as we prep for the 3.18 NXRM release.

@nblair nblair merged commit 62f6658 into master Jul 25, 2019
@nblair nblair deleted the refactor-datastore-integration branch July 25, 2019 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant