SEARCH-2117: Revert limit to 2000l for checking first transactions in database when checking the index and fix Integration Test.

This commit is contained in:
Angel Borroy
2020-02-19 11:43:11 +01:00
parent e9b07609d6
commit f93e979ed9
2 changed files with 8 additions and 5 deletions
@@ -243,7 +243,7 @@ public class MetadataTracker extends CoreStatePublisher implements Tracker
state.setCheckedFirstTransactionTime(true);
log.info("No transactions found - no verification required");
firstTransactions = client.getTransactions(null, 0L, null, Long.MAX_VALUE, 1);
firstTransactions = client.getTransactions(null, 0L, null, 2000l, 1);
if (!firstTransactions.getTransactions().isEmpty())
{
Transaction firstTransaction = firstTransactions.getTransactions().get(0);
@@ -278,7 +278,7 @@ public class MetadataTracker extends CoreStatePublisher implements Tracker
}
}
firstTransactions = client.getTransactions(minCommitTime, 0L, null, Long.MAX_VALUE, 1);
firstTransactions = client.getTransactions(minCommitTime, 0L, null, 2000l, 1);
if (!firstTransactions.getTransactions().isEmpty())
{
Transaction firstTransaction = firstTransactions.getTransactions().get(0);
@@ -311,7 +311,7 @@ public class MetadataTracker extends CoreStatePublisher implements Tracker
{
if (firstTransactions == null)
{
firstTransactions = client.getTransactions(null, 0L, null, Long.MAX_VALUE, 1);
firstTransactions = client.getTransactions(null, 0L, null, 2000l, 1);
}
setLastTxCommitTimeAndTxIdInTrackerState(firstTransactions, state);
@@ -1147,7 +1147,7 @@ public class MetadataTracker extends CoreStatePublisher implements Tracker
{
// DB TX Count
long firstTransactionCommitTime = 0;
Transactions firstTransactions = client.getTransactions(null, 0L, null, Long.MAX_VALUE, 1);
Transactions firstTransactions = client.getTransactions(null, 0L, null, 2000l, 1);
if(firstTransactions.getTransactions().size() > 0)
{
Transaction firstTransaction = firstTransactions.getTransactions().get(0);
@@ -127,7 +127,10 @@ public class AlfrescoSolrUtils
long txnCommitTime = System.currentTimeMillis();
Transaction transaction = new Transaction();
transaction.setCommitTimeMs(txnCommitTime);
transaction.setId(generateId());
// A safer number for a transaction Id should be in [1-2000] range,
// so this is the range accepted for the starting transaction number
// on a SOLR Core
transaction.setId(RANDOMIZER.nextInt(2000) + 1);
transaction.setDeletes(deletes);
transaction.setUpdates(updates);
return transaction;