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

Stale Account Index Cache #27

Open
mikegrima opened this issue May 25, 2023 · 0 comments
Open

Stale Account Index Cache #27

mikegrima opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mikegrima
Copy link
Contributor

mikegrima commented May 25, 2023

One potential issue that can arise is that our singletons may contain stale cached data. AWS Lambda will periodically rotate out the container running the lambda function but until it does, there could be stale data affecting workloads.

This can particularly be an issue with the Account Index and the Starbase. The following scenario can happen:

  1. The Starbase runs and loads the account index
  2. A new AWS account is created and added to the organization
  3. At this point, the account index is now stale - both on S3 and the cached singletons
  4. Eventually, the AccountIndexGeneratorShip runs to update the account index in S3
  5. The Starbase may still have a lingering Lambda function or 2 primed up with the stale index cached
  6. A new task appears and workers need to be tasked
  7. An older Starbase lambda is running the logic to task the workers - the workers are not tasked on the new account because the cached account index on the Starbase doesn't see it yet
  8. After a while, AWS Lambda rotates out the old Starbase lambdas and new ones are invoked and run with the latest index
  9. The task runs again (eventually via an EventBridge CRON if set) and the workers are tasked with the newly created account - all is well now

Eventually, everything will iron itself out. However, I can see value in having the default account index keep a timestamp variable of when it was last instantiated and have it refresh after maybe 30 minutes after that timestamp has passed. That would reduce the likelihood staleness in the Starbase.

@mikegrima mikegrima added the enhancement New feature or request label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant