Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-47396

UDF restore endpoints not to throw error on empty payload

    XMLWordPrintable

Details

    • 1

    Description

      Slack with James Lee:

      Hi Marco, just had a QQ about UDF restore. Would it be possible to have the endpoint accept a payload without UDFs. As an example:
      If I hit the endpoint on a new cluster with no UDFs, I get given

      {"udfMagic":"4D6172636F2072756C6573","udfs":[],"version":"0x01"}

      When I then try to restore that payload, I see

      {"caller":"admin_accounting_endpoint:1204","code":1040,"icause":"missing function definition or body","key":"service.io.request.bad_value","message":"Error processing UDF restore body"}

      This behavior does make sense, but it would be nice if the API could detect that no UDFs were found, then return early (i.e. it doesn't have anything that needs restoring)
      I ask this for two separate reasons:
      1) It means the backup/restore endpoint provides/accepts the same payload (this is the same behavior from other services from what I recall - I've only tested Analytics at the moment)
      2) It means that cbbackupmgr is able to refrain from inspecting the payload and changing behavior conditionally depending on what it contains (ideally, cbbackupmgr should just be a transport mechanism, it doesn't need to be aware of the metadata being backed up)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            marco.greco Marco Greco (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty