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

Ability to better detect or override DBEngine #2009

Open
sbrossie opened this issue Apr 25, 2024 · 1 comment
Open

Ability to better detect or override DBEngine #2009

sbrossie opened this issue Apr 25, 2024 · 1 comment

Comments

@sbrossie
Copy link
Member

sbrossie commented Apr 25, 2024

Kill Bill constructs an instance of the EmbeddedDB abstract class at runtime based on the configuration: It parses the URI scheme to decide whether the underlying engine should be mysql, postgresql, h2 or some generic engine.

When using a package like aws-secretsmanager-jdbc, where the URI is something like jdbc-secretsmanager:mysql://example.com:3306, this breaks the parsing and we end up with a GenericStandaloneDB instead of the MySQLEmbeddedDB.

Most of the functionality may still work, but it will break the global locking we have inside Kill Bill because the runtimeGlobalLocker is instantiated based on the value of such EmbeddedDB.getDBEngine. As a result we end up with a MemoryGlobalLocker which means that in a normal multi-node production environment, there is essentially no global locking and this can lead to all sort of issues (e.g double invoicing).

@sbrossie
Copy link
Member Author

Proposal:

  1. We should at least either WARN or ERR when such MemoryGlobalLocker is being used; perhaps we should even prevent the system from starting unless we have set the org.killbill.server.test.mode property.
  2. We could also modify our parsing scheme to allow for secretsmanager:mysql to be set to mysql scheme (i.e look for a 'contains' instead or 'strict equality').
  3. Alternatively (or in addition to), we could also add a way to override the engine scheme from the properties exposed in our DaoConfig

@sbrossie sbrossie changed the title Ability to detect or override DBEngine Ability to better detect or override DBEngine Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant