Skip to content

Commit

Permalink
Bugfix for segrep integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kartik Ganesh <[email protected]>
  • Loading branch information
kartg committed Mar 12, 2022
1 parent 76f09bb commit 5cdd077
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public abstract class RTarget extends AbstractRefCounted {
protected final RListener listener;
protected final MultiFileWriter multiFileWriter;
protected final Logger logger;
protected final RecoveryState.Index recoveryStateIndex;

protected abstract String getPrefix();

Expand All @@ -52,15 +53,16 @@ public abstract class RTarget extends AbstractRefCounted {

public abstract RState state();

public RTarget(String name, IndexShard indexShard, RecoveryState.Index recoveryIndex, RListener listener) {
public RTarget(String name, IndexShard indexShard, RecoveryState.Index recoveryStateIndex, RListener listener) {
super(name);
this.logger = Loggers.getLogger(getClass(), indexShard.shardId());
this.listener = listener;
this.id = ID_GENERATOR.incrementAndGet();
this.recoveryStateIndex = recoveryStateIndex;
this.indexShard = indexShard;
this.store = indexShard.store();
final String tempFilePrefix = getPrefix() + UUIDs.randomBase64UUID() + ".";
this.multiFileWriter = new MultiFileWriter(indexShard.store(), recoveryIndex, tempFilePrefix, logger, this::ensureRefCount);
this.multiFileWriter = new MultiFileWriter(indexShard.store(), recoveryStateIndex, tempFilePrefix, logger, this::ensureRefCount);
// make sure the store is not released until we are done.
store.incRef();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public ReplicationTarget(
super("replication_status", indexShard, new RecoveryState.Index(), listener);
this.checkpoint = checkpoint;
this.source = source;
state = new ReplicationState(new RecoveryState.Index());
state = new ReplicationState(recoveryStateIndex);
}

@Override
Expand Down

0 comments on commit 5cdd077

Please sign in to comment.