Qpid
  1. Qpid
  2. QPID-3491

windows c++ build with MSSQL storage cannot start with persisted messages in the store

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12
    • Fix Version/s: 0.19
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      Windows 7 x64
      Built with Visual Studio 2008 (tested both 32-bit and 64-bit build)
      cmake 2.8.4

      Description

      Problem:
      Using ONLY the C++ Windows broker with the MSSQL storage provider I cannot start the broker if I have messages persisted in the store. I have tested the Java broker on Windows with the BDB store, and the C++ broker on Linux with the BDB store (I think it's BDB...) and neither of them have this problem, so I am assuming it is just a problem with the MSSQL storage provider.

      Steps to reproduce:

      • get the C++ broker up and running on Windows with the MSSQL storage provider
      • run qpid-config add exchange news-service topic --durable
      • run qpid-config add queue mytopicq --durable
      • run qpid-config bind news-service mytopicq *.news
      • Modify the spout script and set durable to True on the Message
      • Run spout news-service/usa.news
      • Shut down the broker
      • Try to start the broker

      Results:
      It fails to start with the following output:
      2011-09-15 01:10:42 notice MSSQL: Database located: QpidStore
      2011-09-15 01:10:42 critical Unexpected error: Error recovering
      messages: Unknown error 0x800A0BB9: Arguments are of the wrong type,
      are out of acceptable range, or are in conflict with one another.

      Comments:
      This should probably be a blocker, but since I have gotten the Java broker up and running with the BDB store I am not terribly concerned about this now...though it is still a big issue

        Activity

        Brandon Pedersen created issue -
        Hide
        Steve Huston added a comment -

        What MSSQL edition/version are you using?

        Show
        Steve Huston added a comment - What MSSQL edition/version are you using?
        Hide
        Brandon Pedersen added a comment -

        2008 R2 express

        Show
        Brandon Pedersen added a comment - 2008 R2 express
        Hide
        Maxim Smityukhov added a comment -

        ¡Hola, Amigos!

        Recently I got the same troubles.
        The problem was with the zero-length messages.

        look at \qpid\store\ms-sql\MessageRecordset.cpp, method
        ...
        void
        MessageRecordset::recover(qpid::broker::RecoveryManager& recoverer,
        std::map<uint64_t, broker::RecoverableMessage::shared_ptr>& messageMap)
        {
        .......................
        ................

        long contentLength = blobSize - headerFieldLength - headerSize;
        if (msg->loadContent(contentLength))

        { BlobAdapter content(contentLength); content = rs->Fields->Item["fieldTableBlob"]->GetChunk(contentLength); msg->decodeContent(content); }

        ..............
        }

        If contentLength is zero, then

        "
        inline _variant_t Field20::GetChunk ( long Length )

        { VARIANT _result; VariantInit(&_result); HRESULT _hr = raw_GetChunk(Length, &_result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _variant_t(_result, false); }

        "
        raises an error "Unknown error 0x800A0BB9: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."

        because HRESULT _hr = raw_GetChunk(Length, &_result); sets _result to VT_NULL and returns 0x800A0BB9

        I don't know is it wrapper (qpid\store\mssql_store.dir\debug\msado15.tli) correct
        "
        // Wrapper implementations for type library C:\Program Files\Common Files\System\ado\msado15.dll
        // compiler-generated file created 09/26/12 at 12:18:42 - DO NOT EDIT!
        "
        or not... but my decision was to change "if (msg->loadContent(contentLength))" with the "if (contentLength > 0 && msg->loadContent(contentLength))"

        The result is broker started and drain received all restored messages from the queue.

        Show
        Maxim Smityukhov added a comment - ¡Hola, Amigos! Recently I got the same troubles. The problem was with the zero-length messages. look at \qpid\store\ms-sql\MessageRecordset.cpp, method ... void MessageRecordset::recover(qpid::broker::RecoveryManager& recoverer, std::map<uint64_t, broker::RecoverableMessage::shared_ptr>& messageMap) { ....................... ................ long contentLength = blobSize - headerFieldLength - headerSize; if (msg->loadContent(contentLength)) { BlobAdapter content(contentLength); content = rs->Fields->Item["fieldTableBlob"]->GetChunk(contentLength); msg->decodeContent(content); } .............. } If contentLength is zero, then " inline _variant_t Field20::GetChunk ( long Length ) { VARIANT _result; VariantInit(&_result); HRESULT _hr = raw_GetChunk(Length, &_result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _variant_t(_result, false); } " raises an error "Unknown error 0x800A0BB9: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." because HRESULT _hr = raw_GetChunk(Length, &_result); sets _result to VT_NULL and returns 0x800A0BB9 I don't know is it wrapper (qpid\store\mssql_store.dir\debug\msado15.tli) correct " // Wrapper implementations for type library C:\Program Files\Common Files\System\ado\msado15.dll // compiler-generated file created 09/26/12 at 12:18:42 - DO NOT EDIT! " or not... but my decision was to change "if (msg->loadContent(contentLength))" with the "if (contentLength > 0 && msg->loadContent(contentLength))" The result is broker started and drain received all restored messages from the queue.
        Hide
        Steve Huston added a comment -

        Great debugging - thank you. I'd like to add a test case to the regression test suite before finishing this bug up.

        Show
        Steve Huston added a comment - Great debugging - thank you. I'd like to add a test case to the regression test suite before finishing this bug up.
        Steve Huston made changes -
        Field Original Value New Value
        Assignee Steve Huston [ shuston ]
        Hide
        Steve Huston added a comment -

        Fixed on trunk r1399838.

        Show
        Steve Huston added a comment - Fixed on trunk r1399838.
        Steve Huston made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.19 [ 12322452 ]
        Resolution Fixed [ 1 ]
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Steve Huston
            Reporter:
            Brandon Pedersen
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development