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

Flag to allow reads in local #777

Merged
merged 1 commit into from
Feb 28, 2020
Merged

Conversation

sirlensalot
Copy link
Contributor

Allows all pact read-only db ops to be accessible in local directly without module admin.

The flag will be exposed in config in chainweb so that node operators can disable, as the performance impacts can be severe.

GtWrite -> notBypassed
GtCreateTable -> notBypassed
_ | localBypassEnabled -> return ()
| otherwise -> notBypassed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, to be clear, this will allow only the following if local bypass is enabled:

  • read/with-read/with-default-read
  • select
  • keys
  • txids
  • txlog
  • keylog

Disallowed are:

  • insert
  • write
  • update
  • create table

The way this is implemented, you'll only need 2 cases: Write vs. Reads. Will we need to expand this later? If not, we probably don't need the large enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured explicit was better in the general case, in case we decide against some operation in the future, or allow slice-and-dice in config in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, that sounds good

@sirlensalot sirlensalot merged commit b59a305 into master Feb 28, 2020
@sirlensalot sirlensalot deleted the feat/allow-reads-in-local branch February 28, 2020 18:55
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.

2 participants