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

SOLR-6122 POC new cancel handler for Collections api #3033

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

QFREEE
Copy link
Contributor

@QFREEE QFREEE commented Jan 14, 2025

https://issues.apache.org/jira/browse/SOLR-6122

Description

This PR implemented a new overseer level message handler to cancel submitted & in-progress collections api calls. As an example, this PR only opt-in backup collection api for in-progress cancel.

in-progress collections api calls are not complete, as core level cancel is not implemented. Current implemention removes tracking of in-progress collections api from overseers, which can be useful in some situation like backup.

Solution

General flow:
-> Client request cancle with async ID through
http://localhost:8983/solr/admin/collections?action=CANCEL&requestid=1

-> Cancel message handled by OverseerCancelMessageHandler to determine if this asyncId exist and if it's currently in submitted or in-progress state :

  • if submitted: remove from workQueue and clear blockedTasks in case submitted task is in blocked tasks
  • if in-progress: check if is isInProgressCancelable -> remove in-progress tasks from tracking queues in overseer workQueue & runningMap & runningTasks

Api:
New V2 api interface for cancel handler

Overseer:

  • stored asyncId on to ZK's running map to keep track of in-process async task easier
  • Adjust OverseerTaskQueue to handle remove / get item from queue given zk path

OverseerCancelMessageHandler:

  • a new message handler specifically to handle cancel. Since cancel collections api involovs removing queue event from overseer's queue, added this part of logic as message handler instead of a new collection api

Tests

Test locally through CURL, working on testing

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@QFREEE QFREEE changed the title SOLR-6122 POC new cancel handler for SOLR-6122 SOLR-6122 POC new cancel handler for Collections api Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant