Query Using Cursors
Cursors enable clients to fetch large result sets from Pinot in chunks, similar to database cursors. This reduces memory consumption for both the client and server.
Architecture Overview
Cursor responses are now managed at the broker level, with each broker running its own local cleanup scheduled executor. The controller no longer manages cursor response cleanup.
Configuration
Broker Cursor Cleanup Configuration
Add these properties to your broker configuration:
pinot.broker.response_store.cleanup_interval_ms: Interval in milliseconds for the broker to clean up expired cursor responses (default: 3600000, i.e., 1 hour)pinot.broker.response_store.max_age_ms: Maximum age in milliseconds before a cursor response is considered expired
Example Broker Configuration
pinot.broker.response_store.cleanup_interval_ms=3600000
pinot.broker.response_store.max_age_ms=604800000REST API
Fetch Cursor Response
Fetch the next chunk of results using a cursor ID.
Endpoint: GET /responseStore/{requestId}
Query Parameters:
requestId(required): The cursor/response ID
Example:
Delete a Specific Cursor Response
Delete a specific cursor response by ID.
Endpoint: DELETE /responseStore/{requestId}
Example:
Batch Delete Expired Cursor Responses (NEW)
Delete all cursor responses that have expired by a cutoff time. This is useful for operators who want to manually trigger cleanup instead of waiting for the scheduled cleanup.
Endpoint: DELETE /responseStore/
Query Parameters:
expiredBefore(optional): Epoch millisecond cutoff time. Responses withexpirationTimeMsat or before this value will be deleted. If omitted, defaults to the current time.
Example:
Response:
Backward-Incompatible Change
WARNING: As of Apache Pinot version with PR #18203, cursor response cleanup has been moved from the controller to each broker. The controller no longer runs the
ResponseStoreCleanerperiodic task.Operational Impact during Rolling Upgrades:
Controllers upgraded first will no longer clean up cursor responses
Brokers must be upgraded to the new version to enable their own cleanup
Temporary accumulation of expired cursor responses may occur if brokers are not upgraded promptly
Recommendation: Ensure all brokers are upgraded to the new version shortly after upgrading controllers
If manual cleanup is needed during the transition, use the new batch delete API:
DELETE /responseStore/
Usage Example: Fetching Large Result Sets with Cursors
Related Configuration
See Pinot Broker Configuration for a complete list of broker properties.
Last updated
Was this helpful?

