Skip to content

Commit

Permalink
Merge pull request #681 from nomis/fix-ostoken-generation-refresh
Browse files Browse the repository at this point in the history
Fix severe peformance issue accessing keys
  • Loading branch information
jschlyter authored Dec 14, 2024
2 parents 43df67c + 68c6a9e commit 4be49e3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/object_store/Generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "Generation.h"

// Factory
Generation* Generation::create(const std::string path, int umask, bool isToken /* = false */)
Generation* Generation::create(const std::string path, int umask, bool isToken)
{
Generation* gen = new Generation(path, umask, isToken);
if ((gen != NULL) && isToken && (gen->genMutex == NULL))
Expand Down
2 changes: 1 addition & 1 deletion src/lib/object_store/Generation.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Generation
{
public:
// Factory
static Generation* create(const std::string inPath, int inUmask, bool inIsToken = false);
static Generation* create(const std::string inPath, int inUmask, bool inIsToken);

// Destructor
virtual ~Generation();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/object_store/OSToken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ OSToken::OSToken(const std::string inTokenPath, int inUmask)
umask = inUmask;

tokenDir = new Directory(tokenPath);
gen = Generation::create(tokenPath + OS_PATHSEP + "generation", true);
gen = Generation::create(tokenPath + OS_PATHSEP + "generation", umask, true);
tokenObject = new ObjectFile(this, tokenPath + OS_PATHSEP + "token.object", umask, tokenPath + OS_PATHSEP + "token.lock");
tokenMutex = MutexFactory::i()->getMutex();
valid = (gen != NULL) && (tokenMutex != NULL) && tokenDir->isValid() && tokenObject->valid;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/object_store/ObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ObjectFile::ObjectFile(OSToken* parent, std::string inPath, int inUmask, std::st
{
path = inPath;
umask = inUmask;
gen = Generation::create(path, umask);
gen = Generation::create(path, umask, false);
objectMutex = MutexFactory::i()->getMutex();
valid = (gen != NULL) && (objectMutex != NULL);
token = parent;
Expand Down

0 comments on commit 4be49e3

Please sign in to comment.