onceMisery commented on PR #25299:
URL: https://github.com/apache/pulsar/pull/25299#issuecomment-4024116170

     Thanks for raising this concern!
     You're absolutely right that the Admin API is stateless and requests can 
hit
     different workers. My design addresses this through deterministic, 
name-based
     cursor pagination:
    How it works:
    continuationToken is simply the last function name from the previous page
     Each worker independently sorts all function names lexicographically
   The token acts as an exclusive lower bound to find the next page
   No server-side state is required; the token is self-contained
   
   
     This approach works consistently across workers because the sorting is
     deterministic and metadata is replicated.
   
   
     Trade-off:
     If functions are created/deleted during pagination, clients may see 
duplicates
     or miss entries. This is a common limitation of stateless cursor-based 
pagination
     in distributed systems (similar to Kubernetes list pagination or DynamoDB 
queries).
   
   
    One improvement I should make:
     Currently the API returns List<FunctionStatusSummary>. I should wrap this 
in a
     response object with nextContinuationToken (null when no more data), so 
clients
     can easily detect the end of pagination:
     {
       "summaries": [...],
       "nextContinuationToken": "func-xyz" // or null
     }
    The name continuationToken might be ambiguous. What do you think of 
startAfter?  
   
   
     Would this design work for you? I can update the PR accordingly.
   
   
   
   Message ID: ***@***.***>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to