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

ADDED hard_delete option on resolver configuration #3783

Merged
merged 1 commit into from Apr 6, 2023

Conversation

JulienVdG
Copy link
Contributor

@JulienVdG JulienVdG commented Jan 13, 2023

  • Link to issue, e.g. Resolves #NNN
  • Documentation added (if applicable)
  • Tests added
  • Branch rebased on top of current main (git pull --rebase origin main)
  • Changes squashed to a single commit (described here)
  • Build is green in Travis CI
  • You have certified that the contribution is your original work and that you license the work to the project under the Apache 2 license

Resolves #3782

Changes proposed in this pull request:

  • Add hard_delete option in the resolver config and use it to set the deleteType in NewDirAccResolver

/cc @nats-io/core

@JulienVdG JulienVdG changed the title Add hard_delete option on resolver configuration ADDED hard_delete option on resolver configuration Jan 13, 2023
@derekcollison
Copy link
Member

Need to fix test failure..

@JulienVdG
Copy link
Contributor Author

on my computer it fails event on main before my changes :(

@derekcollison
Copy link
Member

The tests pass on main proper, and on your branch when I kept restarting yours it kept failing on the same test.

We do have some flappers but I think there is something legit here.

@JulienVdG
Copy link
Contributor Author

OK, Thanks for checking I'm going to retry and fix that ;)

@JulienVdG JulienVdG marked this pull request as draft January 23, 2023 09:33
@JulienVdG JulienVdG force-pushed the resolver_hard_delete branch 6 times, most recently from 559a534 to c5cfb87 Compare January 23, 2023 14:29
@derekcollison
Copy link
Member

Any updates? We are starting prep for a 2.9.12 release.

@JulienVdG
Copy link
Contributor Author

No sorry I don't get why it fails: I though it would be just a config change but there might be strange side effects.
I tried several changes but even if the changes should not affect the default configuration the tests failed on Travis (On my computer they fail at different stages depending on the options I set to go test like -parallel ... rerunning the failing test alone always work)
Don't wait for me for your release, I'll revisit this MR later.
Thank you !

@derekcollison
Copy link
Member

ok, and FYI we will be moving away from the NATS resolver in the near future for a JetStream KV based resolver.

@JulienVdG
Copy link
Contributor Author

JulienVdG commented Jan 30, 2023

FYI we will be moving away from the NATS resolver in the near future for a JetStream KV based resolver.

oh nice, thanks !

@goku321
Copy link
Contributor

goku321 commented Mar 2, 2023

ok, and FYI we will be moving away from the NATS resolver in the near future for a JetStream KV based resolver.

Is there a doc/ADR for this? Would like to know more about this.

@derekcollison
Copy link
Member

There is not as of yet, but in the simple form you would store account claims in a KV that the server would be configured to use to resolve accounts through KV gets and watchers.

KVs today can already be set up with as many mirrors as you want and KV gets will use the closest replica to respond to the request.

We will convert our own global network NGS to it once complete.

@goku321
Copy link
Contributor

goku321 commented Mar 2, 2023

Thanks for the info. Good to see the JetStream KV store being used in interesting ways!

@JulienVdG JulienVdG force-pushed the resolver_hard_delete branch 3 times, most recently from dde355e to 5111820 Compare April 4, 2023 13:48
@derekcollison
Copy link
Member

We are prepping for 2.9.16 release, do you want this reviewed again for possible inclusion?

@JulienVdG JulienVdG force-pushed the resolver_hard_delete branch 2 times, most recently from c87bec3 to 5111820 Compare April 5, 2023 06:28
Signed-off-by: Julien Viard de Galbert <jviarddegalbert@scaleway.com>
@JulienVdG JulienVdG marked this pull request as ready for review April 5, 2023 08:18
@JulienVdG JulienVdG requested a review from a team as a code owner April 5, 2023 08:18
@JulienVdG
Copy link
Contributor Author

Yes please.
I had time to work on it yesterday, it seams the CI is still sometime flaky as I don't see any links betweem the code change and the errors. Moreover all tests ran on local (I updated go since last time I think it helped)

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

Where is the behavior enforced?

@JulienVdG
Copy link
Contributor Author

Where is the behavior enforced?

The behavior was already present in the DirJWTStore implementation (it's used for the caching resolver: NewCacheDirAccResolver hardcode the delete parameter to HardDelete).

So this PR only allows to use this parameter when creating the DirJWTStore via NewDirAccResolver and does the necessary checks on the configuration options (with hopefully clear enough error messages).

@derekcollison derekcollison self-requested a review April 6, 2023 14:02
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 7b82384 into nats-io:main Apr 6, 2023
1 check passed
@JulienVdG JulienVdG deleted the resolver_hard_delete branch April 7, 2023 14:16
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.

Add option to the nats resolver to hard delete the jwt instead of renaming them to .deleted.
3 participants