Skip to content

Commit

Permalink
reverted part of commit 2a6ea8f: do not reset index id generator afte…
Browse files Browse the repository at this point in the history
…r loading indexes
  • Loading branch information
glookka committed Dec 16, 2023
1 parent cdc3808 commit d67dbe6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/searchd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20233,7 +20233,6 @@ static void ConfigureAndPreloadOnStartup ( const CSphConfig & hConf, const StrVe

InitPersistentPool();

int64_t iIndexId = -1;
ServedSnap_t hLocal = g_pLocalIndexes->GetHash();
for ( const auto& tIt : *hLocal )
{
Expand All @@ -20247,15 +20246,9 @@ static void ConfigureAndPreloadOnStartup ( const CSphConfig & hConf, const StrVe

if ( sWarning.Length() )
sphWarning ( "%s", sWarning.cstr() );

iIndexId = Max ( iIndexId, pIdx->GetIndexId() );
}
}

// set index_id to max of existed indexes after all indexes were loaded
if ( iIndexId!=-1 )
SetIndexId ( iIndexId + 1 );

// set index cluster name for check
for ( const ClusterDesc_t & tClusterDesc : GetClustersInt() )
for ( const auto & tIndex : tClusterDesc.m_hIndexes )
Expand Down
6 changes: 0 additions & 6 deletions src/sphinxutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3543,9 +3543,3 @@ int64_t GenerateIndexId()
{
return g_tIndexId.fetch_add ( 1, std::memory_order_relaxed );
}

void SetIndexId ( int64_t iId )
{
g_tIndexId.store ( iId );
}

1 change: 0 additions & 1 deletion src/sphinxutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ void UidShortSetup ( int iServer, int iStarted );
BYTE Pearson8 ( const BYTE * pBuf, int iLen );

int64_t GenerateIndexId();
void SetIndexId ( int64_t iId );

#if _WIN32
void CheckWinInstall();
Expand Down

0 comments on commit d67dbe6

Please sign in to comment.