Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kkewwei committed Jan 18, 2025
1 parent 93c84bb commit 6afebea
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,15 @@ public IndexResult index(Index index) throws IOException {
* or calls updateDocument.
*/
final IndexingStrategy plan = indexingStrategyForOperation(index);
if (index.origin() == Operation.Origin.PRIMARY) {
reservedDocs = plan.reservedDocs;
} else {
if (index.origin() == Operation.Origin.REPLICA) {
reservedDocs = 0;
} else {
reservedDocs = plan.reservedDocs;
}
if (index.origin() == Operation.Origin.REPLICA && engineConfig.getIndexSettings().isSegRepEnabledOrRemoteNode() == false) {
if (plan != index.indexingStrategy()) {
throw new RuntimeException("plan != index.indexingStrategy()");
}
}

final IndexResult indexResult;
Expand Down Expand Up @@ -1017,6 +1022,9 @@ protected final IndexingStrategy planIndexingAsNonPrimary(Index index) throws IO
} else {
boolean segRepEnabled = engineConfig.getIndexSettings().isSegRepEnabledOrRemoteNode();
versionMap.enforceSafeAccess();
// if (index.origin() == Operation.Origin.REPLICA && segRepEnabled == false) {
//
// }
final OpVsLuceneDocStatus opVsLucene = compareOpToLuceneDocBasedOnSeqNo(index);
if (opVsLucene == OpVsLuceneDocStatus.OP_STALE_OR_EQUAL) {// seqNo小于等于当前已经写入的
if (segRepEnabled) {
Expand Down

0 comments on commit 6afebea

Please sign in to comment.