Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2495

HDFS connection issue during LOB creation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • any
    • 2.2.0
    • sql-exe
    • None

    Description

      In some cases a memory overwrite of the following local variable would cause a bad value for hdfsServer to be passed into the LOB interface causing an Hdfs error. This was seen intermittently and not always reproducible. The code clearly did assume that memory it hadn't allocated would nto be reused and that's dangerous. lobHdfsServer needs it's own memory allocated on the stack or a heap. If not the ComString newSchName could potentially overwrite the memory returned by the call to CmpCommon::getDefaultString(LOB_HDFS_SERVER) before gttting passed to the LOB interface.

      ----------------------

      const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
      Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);

      if (j > 0)
      {
      Int32 rc = sendAllControls(FALSE, FALSE, TRUE);
      //if the table is a volatile table return an error
      if (createTableNode->isVolatile())

      { *CmpCommon::diags() << DgSqlCode(-CAT_LOB_COLUMN_IN_VOLATILE_TABLE) << DgTableName(extTableName); deallocEHI(ehi); processReturn(); return -1; }

      Int64 objUID = getObjectUID(&cliInterface,
      catalogNamePart.data(), schemaNamePart.data(),
      objectNamePart.data(),
      COM_BASE_TABLE_OBJECT_LIT);

      ComString newSchName = "\"";
      newSchName += catalogNamePart;
      newSchName.append("\".\"");
      newSchName.append(schemaNamePart);
      newSchName += "\"";
      NABoolean lobTrace=FALSE;
      if (getenv("TRACE_LOB_ACTIONS"))
      lobTrace=TRUE;
      rc = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
      newSchName.length(),
      objUID,
      j,
      LOB_CLI_CREATE,
      lobNumList,
      lobTypList,
      lobLocList,
      (char *)lobHdfsServer,
      lobHdfsPort,
      lobMaxSize,
      lobTrace);

      if (rc < 0)

      { //sss TBD need to retrive the cli diags here. *CmpCommon::diags() << DgSqlCode(-CAT_CREATE_OBJECT_ERROR) << DgTableName(extTableName); deallocEHI(ehi); processReturn(); return -2; }

      }

      Attachments

        Issue Links

          Activity

            People

              sandhya Sandhya Sundaresan
              sandhya Sandhya Sundaresan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: