Skip to content

Commit

Permalink
[NO ISSUE][REP] Updated Replicated Indexes Checkpoint Predicate
Browse files Browse the repository at this point in the history
- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Remove master partitions filter when selecting replicated
  indexes to checkpoint since the checkpoint will be limited to
  a single partition.
- Ensure any data decrypted before the close is received on SSL
  sockets is delivered to the reader.
- Take a thread dump when an LSN not received from master
  within the timeout to help in diagnosing any synchronization
  issues.

Change-Id: Ie6f11cc10714ec758b824c49c8c1b31ce7794ca5
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15943
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
  • Loading branch information
mhubail committed Apr 1, 2022
1 parent 7c13f70 commit fc9ff17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Predicate;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -86,11 +85,9 @@ public void run() {

private void checkpointReplicaIndexes(RemoteLogRecord remoteLogMapping, int datasetId, int resourcePartition)
throws HyracksDataException {
final Set<Integer> masterPartitions = appCtx.getReplicaManager().getPartitions();
final Predicate<LocalResource> replicaIndexesPredicate = lr -> {
DatasetLocalResource dls = (DatasetLocalResource) lr.getResource();
return dls.getDatasetId() == datasetId && dls.getPartition() == resourcePartition
&& !masterPartitions.contains(dls.getPartition());
return dls.getDatasetId() == datasetId && dls.getPartition() == resourcePartition;
};
final Map<Long, LocalResource> resources =
localResourceRep.getResources(replicaIndexesPredicate, Collections.singleton(resourcePartition));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.asterix.replication.sync.IndexSynchronizer;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.storage.am.lsm.common.impls.IndexComponentFileReference;
import org.apache.hyracks.util.ThreadDumpUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -95,6 +96,7 @@ private void ensureComponentLsnFlushed(INcApplicationContext appCtx)
if (replicationTimeOut <= 0) {
LOGGER.warn("{} seconds passed without receiving flush lsn {} from master for component {}",
appCtx.getReplicationProperties().getReplicationTimeOut(), masterLsn, file);
LOGGER.debug("thead dump on receiving flush lsn timeout {}", ThreadDumpUtil::takeDumpString);
throw new ReplicationException(new TimeoutException("couldn't receive flush lsn from master"));
}
final long startTime = System.nanoTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private int decrypt() throws IOException {
break;
case CLOSED:
close();
return -1;
return decryptedBytes;
default:
throw new IllegalStateException("Invalid SSL result status: " + result.getStatus());
}
Expand Down

0 comments on commit fc9ff17

Please sign in to comment.