vldpyatkov commented on code in PR #4227:
URL: https://github.com/apache/ignite-3/pull/4227#discussion_r1719659414


##########
modules/core/src/main/java/org/apache/ignite/internal/lang/IgniteSystemProperties.java:
##########
@@ -73,6 +73,12 @@ public final class IgniteSystemProperties {
     /** Name of the property controlling whether, when a thread assertion is 
triggered, it should also be written to the log. */
     public static final String THREAD_ASSERTIONS_LOG_BEFORE_THROWING = 
"THREAD_ASSERTIONS_LOG_BEFORE_THROWING";
 
+    /** Skip replication in a benchmark. */
+    public static final String SKIP_REPLICATION_IN_BENCHMARK = 
"SKIP_REPLICATION_IN_BENCHMARK";
+
+    /** Skip storage update in a benchmark. */
+    public static final String SKIP_STORAGE_UPDATE_IN_BENCHMARK = 
"SKIP_STORAGE_UPDATE_IN_BENCHMARK";

Review Comment:
   I want that both of these properties have "IGNITE_" prefix.



##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java:
##########
@@ -171,19 +174,40 @@ public static CompletableFuture<RaftGroupService> start(
             ScheduledExecutorService executor,
             Marshaller commandsMarshaller
     ) {
-        var service = new RaftGroupServiceImpl(
-                groupId,
-                cluster,
-                factory,
-                configuration,
-                membersConfiguration,
-                null,
-                executor,
-                commandsMarshaller
-        );
+        boolean inBenchmark = 
IgniteSystemProperties.getBoolean(IgniteSystemProperties.SKIP_REPLICATION_IN_BENCHMARK,
 false);
+
+        RaftGroupServiceImpl service;
+        if (inBenchmark) {
+            service = new RaftGroupServiceImpl(
+                    groupId,
+                    cluster,
+                    factory,
+                    configuration,
+                    membersConfiguration,
+                    null,
+                    executor,
+                    commandsMarshaller
+            ) {
+                @Override
+                public <R> CompletableFuture<R> run(Command cmd) {
+                    return 
cmd.getClass().getSimpleName().contains("UpdateCommand") ? 
nullCompletedFuture() : super.run(cmd);

Review Comment:
   I worry that if the class name changes, the code will become useless.



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -2795,26 +2761,28 @@ private CompletableFuture<CompletableFuture<?>> 
applyUpdateCommand(
                 return resultFuture.thenApply(res -> {
                     UpdateCommandResult updateCommandResult = 
(UpdateCommandResult) res;
 
-                    if (full && !updateCommandResult.isPrimaryReplicaMatch()) {
+                    if (full && updateCommandResult != null && 
!updateCommandResult.isPrimaryReplicaMatch()) {

Review Comment:
   I think this is done to handle a test result (SKIP_REPLICATION_IN_BENCHMARK).
   Maybe it would be better to give the correct response to avoid this checking.



##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java:
##########
@@ -171,19 +174,40 @@ public static CompletableFuture<RaftGroupService> start(
             ScheduledExecutorService executor,
             Marshaller commandsMarshaller
     ) {
-        var service = new RaftGroupServiceImpl(
-                groupId,
-                cluster,
-                factory,
-                configuration,
-                membersConfiguration,
-                null,
-                executor,
-                commandsMarshaller
-        );
+        boolean inBenchmark = 
IgniteSystemProperties.getBoolean(IgniteSystemProperties.SKIP_REPLICATION_IN_BENCHMARK,
 false);

Review Comment:
   False is the default.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to