Skip to content

Adds AssistantManagerThriftRPCs #6284

Draft
ddanielr wants to merge 5 commits intoapache:mainfrom
ddanielr:feature/accumulo-6183
Draft

Adds AssistantManagerThriftRPCs #6284
ddanielr wants to merge 5 commits intoapache:mainfrom
ddanielr:feature/accumulo-6183

Conversation

@ddanielr
Copy link
Copy Markdown
Contributor

@ddanielr ddanielr commented Apr 1, 2026

Renames the current ManagerClientService to PrimaryManagerClientService.

Adds an AssistantManagerClientService thrift RPC to the manager.

Migrated flush and property actions to the AssistantManagerClientService.

relates to #6183

Renamed the thrift class from ManagerClientService to
PrimaryManagerClientService
Sets up an AssistantManagerThriftClient to use instead of the
PrimaryManager.
Use the AssistantManager Client instead of the PrimaryManager Client
for flush actions
Moves table, system, and namespace property actions to the
assistantManagers
Moves the resourceGroup property actions from PrimaryManager to
AssistantManager
@ddanielr ddanielr added this to the 4.0.0 milestone Apr 1, 2026
@ddanielr ddanielr requested a review from keith-turner April 1, 2026 00:36
Copy link
Copy Markdown
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

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

For testing I suspect ComprehensiveMultiManagerIT will cover a lot of these changes for the multiple manager case. Would be good to review the APIs it calls and the APIs changed here to be sure.


@Override
public Client getConnection(ClientContext context) {
return getManagerConnection(LOG, this, context);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like this will always connect to the primary manager. Need to call [this code] (

var workers = context.getServerPaths().getAssistantManagers(AddressSelector.all(), true);
) to get a list of assistant managers and pick one.

For picking one I have been considering using hashing for #6279 to better spread the connections. If we randomly pick one and we C clients then every assistant manager can have up to C connections or more. If we hash clients to AM assistant managers then each one will have on the order of C/AM connections. This could also help w/ debugging where a client goes to the same manager consistently. However not sure what to hash on in the client. For #6279 was thinking of doing hash mod using the compactor address. To start with it would probably be best to just randomly pick one though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice if we could tie in TServerClient.getThriftServerConnection somehow. Then the debug property would apply to Manager connections as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@keith-turner I saw the code in FateManager, but the FateThriftClient still used the default getConnection method from ManagerClient.

Should FateThriftClient also be updated to select from the assistant Managers?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should FateThriftClient also be updated to select from the assistant Managers?

Can not do that now, fate meta client is only available on the primary manager. After #6224,#6227, and #6232 are merged then both fate clients (meta and user) would be available on all managers. After those are merged could refactor the client code that initiates fate table ops to use any manger.

@keith-turner I saw the code in FateManager, but the FateThriftClient still used the default getConnection method from ManagerClient.

The code in FateThriftClient is for clients that interact with creating and waiting on fate operations. The code in FateManager is distributing execution of fate operations across managers. So what we currently have is fate operations can execute on all managers, but accumulo clients must still work w/ the primary manager to initiate and wait on fate operations. After #6232 is merged then accumulo clients could interact w/ any manager.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay! I opened #6291 for simplifying the thrift client code a bit.

return getManagerConnection(LOG, this, context);
}

public <R> R executeTableCommand(ClientContext context, Exec<R,Client> exec)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this code copied from MangerThriftClient? If so would be good to push to the super type and refactor for any specialization needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

May need to create a new super type that the primary and assistant manager share, not sure. See that a fate client also extends the base type and it may not need some of these methods.

import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException;
import org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException;
import org.apache.accumulo.core.manager.thrift.ManagerClientService.Client;
import org.apache.accumulo.core.manager.thrift.PrimaryManagerClientService.Client;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be good to rename this class from ManagerThriftClient to PrimaryManagerThriftClient

try {
// Acquire the lock that all managers get before the primary lock, this allows non primary
// manager processes to work on stuff.
getAssistantManagerLock();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

getAssistantManagerLock() should also change to advertise the new services the AssistantManager is servicing. This would allow clients to get the addresses for all managers, then select one that is advertising the service that the client needs. TServerClient.getThriftServerConnection does this right now, but only for a subset of services. The logic in that class could be expanded to handle more types.

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