statestore: Implement Lock and Unlock for state stores#1266
Merged
Conversation
Bumps [github.com/hashicorp/copywrite](https://github.com/hashicorp/copywrite) from 0.22.0 to 0.24.0. - [Release notes](https://github.com/hashicorp/copywrite/releases) - [Commits](hashicorp/copywrite@v0.22.0...v0.24.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/copywrite dependency-version: 0.24.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
N/A
Description
This PR implements the
LockStateandUnlockStateRPCs forstatestore.StateStore, as well as adds a simplestatestore.LockInfohelper for representing the lock data in a data store (presumably as JSON, although we can expand it later if there are other use-cases).The general goal here is to provide a good option in framework that is close to the Terraform core
LockInfostruct, which we can then recommend in documentation: https://github.com/hashicorp/terraform/blob/8a615f93e9c11105c6fa79287a0494f8f6a2886a/internal/states/statemgr/locker.go#L113-L141 . It's not required, and the provider developer can ultimately choose how they want to store the lock, as long as theLockIDis able to be retrieved and referenced 👍🏻Rollback Plan
Changes to Security Controls
No