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

WIP: Update external ACL cache to ClpMap #1734

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yadij
Copy link
Contributor

@yadij yadij commented Mar 12, 2024

No description provided.

@yadij yadij marked this pull request as draft March 12, 2024 19:59
@yadij yadij changed the title Update external ACL cache to ClpMap WIP: Update external ACL cache to ClpMap Mar 12, 2024
#endif

// XXX: This state->def access conflicts with the cbdata validity check
// below.
dlinkDelete(&state->list, &state->def->queue);

ExternalACLEntryPointer entry;
if (cbdataReferenceValid(state->def))
entry = external_acl_cache_add(state->def, state->key, entryData);
Copy link
Contributor

@rousskov rousskov Mar 12, 2024

Choose a reason for hiding this comment

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

AFAICT, official code unconditinoally creates ExternalACLEntry (that stores helper lookup info) and passes it to ACLExternal::aclMatchExternal() via ACLFilledChecklist::extacl_entry hack. This approach is ugly as hell, but it does not rely on the cache to keep/pass fresh lookup information: Despite its name, external_acl_cache_add() may actually add nothing to the cache.

PR code removes ACLFilledChecklist::extacl_entry hack and relies on the cache to keep/pass fresh lookup information. This approach is conceptually wrong: Caching is an optimization that we cannot rely on to pass information. The code has to be written so that it continues to work correctly when caching is disabled or otherwise impossible.

Before refactoring to fix this problem, please create a test case that will fail (with the current PR code) when external ACL caching is disabled.

@rousskov rousskov added the S-waiting-for-author author action is expected (and usually required) label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-for-author author action is expected (and usually required)
Projects
None yet
2 participants