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

Fix primary database not filter #295

Conversation

flaming-archer
Copy link
Contributor

📝 Description

When database-resolution set manual,primary database also config some database,so to determine whether to add the fed database, it should be necessary to filter out the ones that are not in the primary database.

🔗 Related Issues

@flaming-archer
Copy link
Contributor Author

flaming-archer commented Sep 28, 2023

@patduin Could you help to take a look at this? It hasn't really changed anything. Let the primaly database be used as a filter, only for its configuration, not for all.It seems very important, for example, we only select some of the primaly databasese.

Copy link
Contributor

@patduin patduin left a comment

Choose a reason for hiding this comment

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

Please add some tests. Perhaps consider jUnit and WaggeDanceIntegrationTest for this usecase.

@flaming-archer
Copy link
Contributor Author

Please add some tests. Perhaps consider jUnit and WaggeDanceIntegrationTest for this usecase.

Sorry for late replay, I will add some tests later.

@flaming-archer
Copy link
Contributor Author

@patduin hi,I have been very busy lately and finally have time to write. I have added a test, please help me review it.

@patduin
Copy link
Contributor

patduin commented Nov 2, 2023 via email

@flaming-archer
Copy link
Contributor Author

@patduin Could you take a look at this. If ok, please merge it.

@patduin
Copy link
Contributor

patduin commented Nov 17, 2023

flaming-archer

Hi,

I've been busy on this as it is a bit tricky.

Thanks for writing the test that helped me understand what you were trying to fix!

Looking into this I thought the use of this panoptic class was a bit weird as we do filtering already when we add the metastore to the list (using the Allowlist).
I've made a different solution which also removes this cache which I believe is not necessary anymore.
I think it's an historical piece where we had a usecase that created databases on the metastore directly (outside of WD) and we wanted to pick those up, before we had mapping implemented.
The StaticDatabaseMappingService gets created and loaded for every request so I don't think this cache solves anything that a user can't easily solve by just reconnecting.

Why is this all tricky?
When doing static (manual) mapping things become hard when new databases are created that cause a crash, if we just crashloop WD throwing exception that the mapping should be updated. This is why I prefer the prefixes less risk of this.
I've raised a PR for this here, please have a look. And big disclaimer (sadly) I think I mentioned this before we don't run Hive3 at our company so we do not have QA setup for this branch just the unit test, please run your own QA before accepting this.
As always thanks for the contribution keen to hear your thoughts.

@patduin patduin closed this Nov 23, 2023
@patduin
Copy link
Contributor

patduin commented Nov 23, 2023

Closed in favour of: #302

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.

2 participants