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

Fixed RD-15170: Reuse existing DASes when registering the same credential #17

Conversation

bgaidioz
Copy link
Contributor

@bgaidioz bgaidioz commented Nov 25, 2024

When a new DAS is registered, the cache introduced in that changeset, that indexes DAS instances by their options, is updated. If a redundant registration request is received for the same DAS type with identical options, the existing DAS instance is returned. This prevents the creation of a duplicate DAS and the associated synchronization with its external system.

The latest patch works as follows:

  • an index from DAS ID to DAS config, which is used to makek sure explicit IDs are sent with a matching known config
  • an index (using Cache/CacheLoader) that indexes runtime DASes from the config.

When a DAS is created, assuming the config matches a potential DAS ID passed among the parameters, the runtime DAS cache is accessed to either create a populate a new entry, or reuse a known one.

@bgaidioz bgaidioz force-pushed the RD-15170-das-server-doesnt-reuse-existing-da-ses-when-the-same-options-are-registered branch from 91734ce to 65418dc Compare November 26, 2024 08:16
@bgaidioz bgaidioz marked this pull request as draft November 26, 2024 08:31
@bgaidioz bgaidioz force-pushed the RD-15170-das-server-doesnt-reuse-existing-da-ses-when-the-same-options-are-registered branch from 9752521 to b539c06 Compare November 26, 2024 09:08
@bgaidioz bgaidioz marked this pull request as ready for review November 26, 2024 09:25
@bgaidioz
Copy link
Contributor Author

During review, we note that after this patch, deleting and re-creating the exact same credential, will hit the cache and will call the getTableDescription of the formerly allocated DAS instance. It's up to the DAS to figure out whether it should update its list of tables or not (certain DASes would need to).

@bgaidioz bgaidioz merged commit 9815010 into main Nov 26, 2024
2 checks passed
@bgaidioz bgaidioz deleted the RD-15170-das-server-doesnt-reuse-existing-da-ses-when-the-same-options-are-registered branch November 26, 2024 14:34
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