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

Move all AtlasDB persisters to the new reusable type #2300

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

raiju
Copy link
Contributor

@raiju raiju commented Jun 13, 2022

Before this PR

Non-reusable persisters are created for each cell read/write. This causes a lot of object creation, which is particularly problematic when a new object mapper is created,

After this PR

==COMMIT_MSG==
Enforce all AtlasDB persisters to be marked as reusable
==COMMIT_MSG==

Possible downsides?

  • Should applying this fix be broken out into a separate excavator to ensure enough attention is paid to it? I haven't found a single non-reusable persister yet, but I'm sure they exist.
  • @jeremyk-91 @Jolyon-S Are there reasons to not do this?

@changelog-app
Copy link

changelog-app bot commented Jun 13, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Enforce all AtlasDB persisters to be marked as reusable

Check the box to generate changelog(s)

  • Generate changelog entry

@carterkozak
Copy link
Contributor

Given that we own the persister API, I would prefer if we updated the API in such a way that it's difficult to get wrong rather than relying on static analysis.

@raiju
Copy link
Contributor Author

raiju commented Jun 13, 2022

I'd prefer that too; @jeremyk-91 is there a world where we could flip the expectations/always enforce this?

@carterkozak Would you be ok merging this with a plan to get persisters to be safe by default?

@jeremyk-91
Copy link

No objections to changing the API in the long term (in fact that's preferable, I remember this bit of defensiveness being somewhat annoying to add) - the main thing is how to get there. If this is likely to have people touch each of their persisters, I'm thinking if we should instead do:

  • add @StatefulPersister annotation to AtlasDB (or something like that)
  • require users to specify at least one
  • (not 100% safe, but probably >99%) after some point in time, switch the default behaviour over

@raiju raiju force-pushed the sk/add-atlasdb-reusable-rule branch from 651a263 to d68dac8 Compare July 11, 2022 20:46
@raiju raiju changed the title Enforce all AtlasDB persisters to be marked as reusable Move all AtlasDB persisters to the new reusable type Jul 11, 2022
@raiju
Copy link
Contributor Author

raiju commented Jul 11, 2022

Refactored this to support the new setup (only ReusablePersisters are supported, Persisters are deprecated)

@@ -50,6 +50,7 @@ public class BaselineErrorProneExtension {
"LambdaMethodReference",
"LoggerEnclosingClass",
"LogsafeArgName",
"NonReusableAtlasdbPersister",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this appropriate for this check? We want to move everyone to this new persister given the risks of the old persister

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.

None yet

5 participants