Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-13865

Create new macro WT_RET_SUB and WT_ERR_SUB

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT12.0.0, 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: APIs
    • None
    • Storage Engines
    • 5
    • StorEng - 2025-01-21

      This ticket refers to the direct WT_RET_SUB and WT_ERR_SUB section within the technical design. After milestone 1, a basic API and structure should be created on the session structure. The work involved in this ticket is to create a new macro called WT_RET_VERBOSE_MSG and WT_ERR_SUB macro and should have an example from the customer listed use cases show casing the return of a sub-level error code, last error code and error message that has occurred in the session API call. The behaviour of the error message in the API must adhere to these rules:

      * Error messages are optional, and will be returned with an empty string (“”) by default upon an error.
      * WiredTiger will own the memory lifetime of the string
      * The pointer to the string will be invalidated on the next session API call. Users should copy the string if they want to retain this information.
      * Any subsequent session API call will invalidate the pointer to the string.
      

      Furthermore, we must make sure that the next session API call would replace or clear the sub-level error code and error code. An example what the usage of new macro would look like:

      WT_RET_SUB(session, EINVAL, WT_INVALID_EXAMPLE, "Example EINVAL");
      

      Defintion of done
      A new macro is created, with unit tests and pythons that showcase an example (from customer listed use case) of the API call.

            Assignee:
            dylan.liang@mongodb.com Dylan Liang (Inactive)
            Reporter:
            jie.chen@mongodb.com Jie Chen
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: