You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by sandhyasun <gi...@git.apache.org> on 2016/03/04 08:05:48 UTC

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

GitHub user sandhyasun opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/363

    Support for doing GC on LOB data files and removing functionality from mxlobsrvr process TRAFODION-1848

    The following set of changes are being committed : 
    1. Moved all calls made in mxlobsrvr process into the master. Removed interprocess sned/recieve calls and made them function calls all done within master. Retianed the minimum infrastructure to mxlobsrvr but it's not started anymore during sqstart. 
    2. Add a new LOB call to perform GC. Made this a new CLI call so we could extend it later to be a utility that can be called offline. For now this CLI cll will be triggered if a certain threshold is met during an insert/update/append operation. This GC is done per lob column (i.e per lob data file). Each lob column's GC can be done independently and do not need to be done all at once. Dpeneds on how much space each lob column ins occupying.
    3 . Removed all uses of hardcoded references ot lob location and hdfsServer and hdfs port. ALl these are set via CQDs and are passed in to needed Tdbs. 
    4. A new testcase has been added to executor/TEST130  to exercise the new code. 


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sandhyasun/incubator-trafodion lob_gc_work

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/363.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #363
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55418597
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9581,15 +9531,14 @@ Lng32 SQLCLI_LOBcliInterface
     
     	if (cliRC < 0)
     	  {
    -	    cliInterface->executeImmediate("cqd pos restore;");
    -
    +	    
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
     	    
     	    goto error_return;
     	  }
     
                	// create lob descriptor chunks table salted
    -       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, intParam largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
    +       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, dataOffset largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
     	lobDescChunksName); 
    --- End diff --
    
    Yes normally it will. It is safe to make this change now since the feature is not officially "externalized". 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55392981
  
    --- Diff: core/sql/exp/ExpLOB.cpp ---
    @@ -186,13 +173,114 @@ Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap,
       else
         lobGlobL = lobGlob;
     
    -  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,(char *)"default",lobMaxSize);
    +  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,hdfsServer,lobMaxSize, hdfsPort);
    +
    +  return rc;
    +}
    +void ExpLOBoper::calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries)
    +{
    +  Int32 i = 0;
    +  //Check if there is a hole right up front for the first entry. If so start compacting with the first entry.
    +  if (dcArray[0].getCurrentOffset() != 0)
    +    {
    +      dcArray[0].setNewOffset(0);
    +      for (i = 1; i < numEntries; i++)
    +        {
    +          dcArray[i].setNewOffset(dcArray[i-1].getNewOffset() + dcArray[i-1].getChunkLen());
    +        }
    +    }
    +  else
    +    //Look for the first unused section and start compacting from there.
    +    {
    +      NABoolean done = FALSE;
    +      i = 0;
    +      Int32 j = 0;
    +      while (i < numEntries && !done )
    +        {
    +          if ((dcArray[i].getCurrentOffset()+dcArray[i].getChunkLen()) != 
    +              dcArray[i+1].getCurrentOffset())
    +            {
    +              j = i+1;
    +              while (j < numEntries)
    +                {
    +                   dcArray[j].setNewOffset(dcArray[j-1].getNewOffset()+dcArray[j-1].getChunkLen());
    +                   j++;
    +                }
    +              done = TRUE;
    +            }
    +          i++;
    +        }
    +    }
    +  return ;
    +}
    +
    +Lng32 ExpLOBoper::compactLobDataFile(void *lobGlob,ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries,char *tgtLobName,Int64 lobMaxChunkMemSize, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +  // Call ExeLOBinterface to create the LOB
    +  if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    + 
    +  if (rc)
    --- End diff --
    
    Harmless but unnecessary as this 'if' can never be true.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55393471
  
    --- Diff: core/sql/exp/ExpLOB.cpp ---
    @@ -186,13 +173,114 @@ Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap,
       else
         lobGlobL = lobGlob;
     
    -  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,(char *)"default",lobMaxSize);
    +  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,hdfsServer,lobMaxSize, hdfsPort);
    +
    +  return rc;
    +}
    +void ExpLOBoper::calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries)
    +{
    +  Int32 i = 0;
    +  //Check if there is a hole right up front for the first entry. If so start compacting with the first entry.
    +  if (dcArray[0].getCurrentOffset() != 0)
    +    {
    +      dcArray[0].setNewOffset(0);
    +      for (i = 1; i < numEntries; i++)
    +        {
    +          dcArray[i].setNewOffset(dcArray[i-1].getNewOffset() + dcArray[i-1].getChunkLen());
    +        }
    +    }
    +  else
    +    //Look for the first unused section and start compacting from there.
    +    {
    +      NABoolean done = FALSE;
    +      i = 0;
    +      Int32 j = 0;
    +      while (i < numEntries && !done )
    +        {
    +          if ((dcArray[i].getCurrentOffset()+dcArray[i].getChunkLen()) != 
    +              dcArray[i+1].getCurrentOffset())
    +            {
    +              j = i+1;
    +              while (j < numEntries)
    +                {
    +                   dcArray[j].setNewOffset(dcArray[j-1].getNewOffset()+dcArray[j-1].getChunkLen());
    +                   j++;
    +                }
    +              done = TRUE;
    +            }
    +          i++;
    +        }
    +    }
    +  return ;
    +}
    +
    +Lng32 ExpLOBoper::compactLobDataFile(void *lobGlob,ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries,char *tgtLobName,Int64 lobMaxChunkMemSize, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +  // Call ExeLOBinterface to create the LOB
    +  if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    + 
    +  if (rc)
    +	return -1;
    +   
    +  rc = ExpLOBinterfacePerformGC(lobGlobL,tgtLobName, (void *)dcArray, numEntries,hdfsServer,hdfsPort,lobLoc,lobMaxChunkMemSize);
    +  
    +  return rc;
    +}
    +
    +Int32 ExpLOBoper::restoreLobDataFile(void *lobGlob, char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +   if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    +  rc = initLOBglobal(lobGlobL, lobHeap);
    +  if (rc)
    +    return -1;
    +    
    +  rc = ExpLOBinterfaceRestoreLobDataFile(lobGlobL,hdfsServer,hdfsPort,lobLoc,lobName);
    +   return rc;
     
    +}
    +
    +Int32 ExpLOBoper::purgeBackupLobDataFile(void *lobGlob,char *lobName, void *lobHeap, char * hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +  if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    +  rc = initLOBglobal(lobGlobL, lobHeap);
    --- End diff --
    
    Same comment as in the prior method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55239271
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9671,7 +9622,12 @@ Lng32 SQLCLI_LOBcliInterface
     	if (cliRC < 0)
     	  {
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
    -	    
    +	     cliInterface->retrieveSQLDiagnostics(myDiags);
    --- End diff --
    
    This got duplicated - could be removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55454391
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9684,15 +9640,17 @@ Lng32 SQLCLI_LOBcliInterface
     	cliRC = cliInterface->executeImmediate(query);
     
     	currContext.resetSqlParserFlags(0x1);
    -
    +	
     	if (cliRC < 0)
     	  {
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
    -	    
    +	    if (myDiags->containsError(-CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION))
    --- End diff --
    
    Found a related issue with drop schema and ddl transactions. I am going to backout this change and not filter out any errors. It does not help with ddl transactions - the diagnostics not being cleared causes problems during transaction commit. So opened JIRA TRAFODION-1883 and will fix it shortly (as part of a separate pull request) . 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55418461
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9684,15 +9640,17 @@ Lng32 SQLCLI_LOBcliInterface
     	cliRC = cliInterface->executeImmediate(query);
     
     	currContext.resetSqlParserFlags(0x1);
    -
    +	
     	if (cliRC < 0)
     	  {
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
    -	    
    +	    if (myDiags->containsError(-CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION))
    --- End diff --
    
    We will ignore only this particular  error. If it's any other error, we go to "error_return". That will return an error to the calling layer. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/363


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55393378
  
    --- Diff: core/sql/exp/ExpLOB.cpp ---
    @@ -186,13 +173,114 @@ Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap,
       else
         lobGlobL = lobGlob;
     
    -  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,(char *)"default",lobMaxSize);
    +  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,hdfsServer,lobMaxSize, hdfsPort);
    +
    +  return rc;
    +}
    +void ExpLOBoper::calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries)
    +{
    +  Int32 i = 0;
    +  //Check if there is a hole right up front for the first entry. If so start compacting with the first entry.
    +  if (dcArray[0].getCurrentOffset() != 0)
    +    {
    +      dcArray[0].setNewOffset(0);
    +      for (i = 1; i < numEntries; i++)
    +        {
    +          dcArray[i].setNewOffset(dcArray[i-1].getNewOffset() + dcArray[i-1].getChunkLen());
    +        }
    +    }
    +  else
    +    //Look for the first unused section and start compacting from there.
    +    {
    +      NABoolean done = FALSE;
    +      i = 0;
    +      Int32 j = 0;
    +      while (i < numEntries && !done )
    +        {
    +          if ((dcArray[i].getCurrentOffset()+dcArray[i].getChunkLen()) != 
    +              dcArray[i+1].getCurrentOffset())
    +            {
    +              j = i+1;
    +              while (j < numEntries)
    +                {
    +                   dcArray[j].setNewOffset(dcArray[j-1].getNewOffset()+dcArray[j-1].getChunkLen());
    +                   j++;
    +                }
    +              done = TRUE;
    +            }
    +          i++;
    +        }
    +    }
    +  return ;
    +}
    +
    +Lng32 ExpLOBoper::compactLobDataFile(void *lobGlob,ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries,char *tgtLobName,Int64 lobMaxChunkMemSize, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +  // Call ExeLOBinterface to create the LOB
    +  if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    + 
    +  if (rc)
    +	return -1;
    +   
    +  rc = ExpLOBinterfacePerformGC(lobGlobL,tgtLobName, (void *)dcArray, numEntries,hdfsServer,hdfsPort,lobLoc,lobMaxChunkMemSize);
    +  
    +  return rc;
    +}
    +
    +Int32 ExpLOBoper::restoreLobDataFile(void *lobGlob, char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +   if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    +  rc = initLOBglobal(lobGlobL, lobHeap);
    --- End diff --
    
    Not sure I understand the point of the 'if'. In both cases, lobGlobL will be equal to lobGlob when we call initLOBglobal. Why not just code "rc = initLOBglobal(lobGlob, lobHeap)" once and be done with it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55421989
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9684,15 +9640,17 @@ Lng32 SQLCLI_LOBcliInterface
     	cliRC = cliInterface->executeImmediate(query);
     
     	currContext.resetSqlParserFlags(0x1);
    -
    +	
     	if (cliRC < 0)
     	  {
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
    -	    
    +	    if (myDiags->containsError(-CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION))
    --- End diff --
    
    Right, but myDiags could contain more than one error, right? What happens then?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55391151
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9684,15 +9640,17 @@ Lng32 SQLCLI_LOBcliInterface
     	cliRC = cliInterface->executeImmediate(query);
     
     	currContext.resetSqlParserFlags(0x1);
    -
    +	
     	if (cliRC < 0)
     	  {
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
    -	    
    +	    if (myDiags->containsError(-CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION))
    --- End diff --
    
    What if there are other errors in myDiags along with CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION; is it OK to ignore them as well?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55418965
  
    --- Diff: core/sql/exp/ExpLOB.cpp ---
    @@ -186,13 +173,114 @@ Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap,
       else
         lobGlobL = lobGlob;
     
    -  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,(char *)"default",lobMaxSize);
    +  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,hdfsServer,lobMaxSize, hdfsPort);
    +
    +  return rc;
    +}
    +void ExpLOBoper::calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries)
    +{
    +  Int32 i = 0;
    +  //Check if there is a hole right up front for the first entry. If so start compacting with the first entry.
    +  if (dcArray[0].getCurrentOffset() != 0)
    +    {
    +      dcArray[0].setNewOffset(0);
    +      for (i = 1; i < numEntries; i++)
    +        {
    +          dcArray[i].setNewOffset(dcArray[i-1].getNewOffset() + dcArray[i-1].getChunkLen());
    +        }
    +    }
    +  else
    +    //Look for the first unused section and start compacting from there.
    +    {
    +      NABoolean done = FALSE;
    +      i = 0;
    +      Int32 j = 0;
    +      while (i < numEntries && !done )
    +        {
    +          if ((dcArray[i].getCurrentOffset()+dcArray[i].getChunkLen()) != 
    +              dcArray[i+1].getCurrentOffset())
    +            {
    +              j = i+1;
    +              while (j < numEntries)
    +                {
    +                   dcArray[j].setNewOffset(dcArray[j-1].getNewOffset()+dcArray[j-1].getChunkLen());
    +                   j++;
    +                }
    +              done = TRUE;
    +            }
    +          i++;
    +        }
    +    }
    +  return ;
    +}
    +
    +Lng32 ExpLOBoper::compactLobDataFile(void *lobGlob,ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries,char *tgtLobName,Int64 lobMaxChunkMemSize, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +  // Call ExeLOBinterface to create the LOB
    +  if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    + 
    +  if (rc)
    +	return -1;
    +   
    +  rc = ExpLOBinterfacePerformGC(lobGlobL,tgtLobName, (void *)dcArray, numEntries,hdfsServer,hdfsPort,lobLoc,lobMaxChunkMemSize);
    +  
    +  return rc;
    +}
    +
    +Int32 ExpLOBoper::restoreLobDataFile(void *lobGlob, char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
    +{
    +  Int32 rc = 0;
    +  void * lobGlobL = NULL;
    +   if (lobGlob == NULL)
    +    {
    +      rc = initLOBglobal(lobGlobL, lobHeap);
    +      if (rc)
    +	return -1;
    +    }
    +  else
    +    lobGlobL = lobGlob;
    +  rc = initLOBglobal(lobGlobL, lobHeap);
    --- End diff --
    
    You found a defect. The if is needed and we cannot call initLOBglobal if lobGlob was passed in. Correcting that. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: Support for doing GC on LOB data...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/363#discussion_r55391332
  
    --- Diff: core/sql/cli/Cli.cpp ---
    @@ -9581,15 +9531,14 @@ Lng32 SQLCLI_LOBcliInterface
     
     	if (cliRC < 0)
     	  {
    -	    cliInterface->executeImmediate("cqd pos restore;");
    -
    +	    
     	    cliInterface->retrieveSQLDiagnostics(myDiags);
     	    
     	    goto error_return;
     	  }
     
                	// create lob descriptor chunks table salted
    -       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, intParam largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
    +       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, dataOffset largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
     	lobDescChunksName); 
    --- End diff --
    
    Does renaming a column imply an upgrade step when this software is installed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---