← 输入框|github.com|刷新
Skip to content

Add missing providers to the statically loaded fallback - #1377

Open
555aaditya wants to merge 3 commits into
sqlancer:mainfrom
555aaditya:fix/799-provider-fallback-list
Open

555aaditya wants to merge 3 commits into
sqlancer:mainfrom
555aaditya:fix/799-provider-fallback-list

Conversation

@555aaditya

Copy link
Copy Markdown

Related to #799.

When ServiceLoader finds no providers, Main.checkForIssue799 falls back to a hard-coded list of providers. That list is from June 2023 and is missing Cloudberry, DataFusion, and VoltDB, so these three cannot be selected in that situation.

This PR:

  • moves the list into Main.getStaticallyLoadedProviders() (no behavior change),
  • adds CloudberryProvider, DataFusionProvider, and VoltDBProvider, and drops the outdated date from the warning,
  • adds TestStaticProviderList, which compares the fallback with the providers registered via @AutoService, so that a new provider cannot be forgotten again. Providers defined in test/ (VirtualDBProvider) are ignored.

It does not address the root cause of #799 (the annotation processor not running in some IDE setups, or on some JVMs), which I could not reproduce, so I left the issue open.

Verified on macOS (arm64), OpenJDK 11.0.33, Maven 3.10.1:

  • mvn -B verify -DskipTests=true: BUILD SUCCESS on each of the three commits.
  • python3 src/check_names.py: exit 0.
  • mvn -Djacoco.skip=true '-Dtest=!sqlancer.dbms.**,!sqlancer.qpg.**' test: 126 tests, 0 failures, 3 skipped (125 tests, same result, on origin/main).
  • The new test fails with the old list, where the providers missing from the fallback are exactly CloudberryProvider, DataFusionProvider, and VoltDBProvider; it passes with the new list.

Not verified: the empty-ServiceLoader scenario itself (I ran the fallback list through the test only); the DBMS smoke tests, which this change does not touch.

@mrigger

The fallback for issue sqlancer#799 builds its provider list inline in checkForIssue799. Move it into getStaticallyLoadedProviders() so that it can be inspected and tested. Behavior is unchanged.
The fallback for issue sqlancer#799 lists the providers known on June 7, 2023, so Cloudberry, DataFusion, and VoltDB cannot be selected when ServiceLoader finds no providers. Add them, and drop the outdated date from the warning message.
Compare the providers of the issue sqlancer#799 fallback with the providers that the @autoservice annotation registers, so that a new provider cannot be forgotten in the fallback again. Providers defined by tests are ignored.
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.

1 participant