Skip to content

Conversation

@andrew4699
Copy link
Contributor

listCatalogs is non-atomic. It first atomically lists all entities and then iterates through each one and does an individual loadEntity call. This causes an NPE when calling CatalogEntity::new.

I don't think it's ever useful for listCatalogsUnsafe to return null since the caller isn't expecting a certain length of elements, so I just filtered it there.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @andrew4699 ! PolarisAdminService changes LGTM, but I have some minor comments in test code :)

"my-catalog-2"),
List.of());

metaStoreManager.fakeEntityNotFoundIds.add(catalog1.getCatalog().getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind making a setter/adder method for this as opposed to accessing a public field?

* Intended to be a delegate to TransactionalMetaStoreManagerImpl with the ability to inject faults.
* Currently, you can force loadEntity() to return ENTITY_NOT_FOUND for a set of entity IDs.
*/
public class TestPolarisMetaStoreManager extends TransactionalMetaStoreManagerImpl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not make it an inner class in ManagementServiceTest?

@dimas-b dimas-b requested a review from eric-maynard June 26, 2025 18:18
@andrew4699
Copy link
Contributor Author

Updated!

@andrew4699 andrew4699 requested a review from dimas-b June 26, 2025 18:32
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jun 26, 2025
@eric-maynard eric-maynard merged commit 3fea897 into apache:main Jun 26, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Jun 26, 2025
snazy pushed a commit that referenced this pull request Aug 7, 2025
`PolarisAdminService` has multiple spots where it is working around the
sub-optimal `PolarisMetaStoreManager` APIs.

This results in multiple fixes like #1949 and #2258

While eventually the underlying APIs should be improved, for now we can
make a single central workaround and clean up some redundant code.
Also we can improve the return types as callers are not interested in
details of the entity layer.
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.

3 participants