shounakmk219 opened a new pull request, #11077:
URL: https://github.com/apache/pinot/pull/11077

   Expose an endpoint to perform safety check validation of the instance retag/ 
tag update operation. 
   Right now in order to update the tags on an instance we use
   
   - `/instances/{instanceName}/updateTags` 
   
   **Problem**
   This operation blindly updates the instance tags without taking into 
consideration the possible consequences such as table replication not being 
satsfied. 
   
   **Proposal**
   Provide a validation API that takes the desired user state as input and 
provides the user with the information if the retag is safe else give all the 
possible reasons for it being unsafe.
   
   Endpoint : `/instances/updateTags/validate`
   Method type : `POST`
   Request body : 
   ```
   [
     {
       "instanceName": "Server_a.c.com_20000",
       "newTags": [
         "tenantA_OFFLINE",
         "tenantA_REALTIME"
       ]
     },
     {
       "instanceName": "Server_b.c.com_20000",
       "newTags": [
         "tenantB_OFFLINE",
         "tenantB_REALTIME"
       ]
     }
   ]
   ```
   Sample Response : 
   
   ```
   [
     {
       "instanceName": "Broker_127.0.0.1_8000",
       "issues": [
         {
           "code": "MINIMUM_INSTANCE_UNSATISFIED",
           "message": "Tenant 'DefaultTenant' will not satisfy minimum 'broker' 
requirement if tag 'DefaultTenant_BROKER' is removed from broker instance 
'Broker_127.0.0.1_8000'."
         },
         {
           "code": "UNRECOGNISED_TAG_TYPE",
           "message": "The tag 'tenantA' does not follow the suffix convention 
of either broker or server"
         }
       ],
       "isSafe": false
     },
     {
       "instanceName": "Server_127.0.0.1_7050",
       "issues": [
         {
           "code": "MINIMUM_INSTANCE_UNSATISFIED",
           "message": "Tenant 'DefaultTenant' will not satisfy minimum 'server' 
requirement if tag 'DefaultTenant_REALTIME' is removed from server instance 
'Server_127.0.0.1_7050'."
         }
       ],
       "isSafe": false
     },
     {
       "instanceName": null,
       "issues": [
         {
           "code": "ALREADY_DEFICIENT_TENANT",
           "message": "Tenant 'DefaultTenant_OFFLINE' is low on 'server' 
instances by 1 even with given allocation"
         }
       ],
       "isSafe": false
     }
   ]
   ```


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to