Skip to content

Commit

Permalink
raft-messages.log can now be enabled/disabled via config.
Browse files Browse the repository at this point in the history
 It is disabled by default as per production norms.
  • Loading branch information
jimwebber authored and apcj committed Feb 25, 2016
1 parent ee7cf72 commit cafb75f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,8 @@ public String toString()
@Description("RAFT meta data cache size (in unit of entries)")
public static final Setting<Integer> raft_log_meta_data_cache_size =
setting( "core_edge.raft_log_meta_data_cache_size", INTEGER, "100000" );

@Description("Enable or disable the dump of all network messages pertaining to the RAFT protocol")
public static final Setting<Boolean> raft_messages_log_enable =
setting( "core_edge.raft_messages_log_enable", BOOLEAN, "false");
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import org.neo4j.cluster.ExecutorLifecycleAdapter;
import org.neo4j.coreedge.catchup.CatchupServer;
import org.neo4j.coreedge.catchup.CheckpointerSupplier;
import org.neo4j.coreedge.catchup.DataSourceSupplier;
Expand Down Expand Up @@ -98,11 +97,13 @@
import org.neo4j.coreedge.server.core.locks.ReplicatedLockTokenStateMachine;
import org.neo4j.coreedge.server.logging.BetterMessageLogger;
import org.neo4j.coreedge.server.logging.MessageLogger;
import org.neo4j.coreedge.server.logging.NullMessageLogger;
import org.neo4j.graphdb.DependencyResolver;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.DatabaseAvailability;
import org.neo4j.kernel.impl.transaction.log.PhysicalLogFile;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
import org.neo4j.kernel.internal.KernelData;
import org.neo4j.kernel.NeoStoreDataSource;
Expand All @@ -125,7 +126,6 @@
import org.neo4j.kernel.impl.store.stats.IdBasedStoreEntityCounters;
import org.neo4j.kernel.impl.transaction.TransactionHeaderInformationFactory;
import org.neo4j.kernel.impl.transaction.log.LogicalTransactionStore;
import org.neo4j.kernel.impl.transaction.log.PhysicalLogFile;
import org.neo4j.kernel.impl.transaction.log.TransactionIdStore;
import org.neo4j.kernel.impl.util.Dependencies;
import org.neo4j.kernel.internal.DatabaseHealth;
Expand Down Expand Up @@ -204,8 +204,15 @@ public EnterpriseCoreEditionModule( final PlatformModule platformModule,
config.get( CoreEdgeClusterSettings.transaction_advertised_address ),
config.get( CoreEdgeClusterSettings.raft_advertised_address ) );

final MessageLogger<AdvertisedSocketAddress> messageLogger =
new BetterMessageLogger<>( myself.getRaftAddress(), raftMessagesLog( storeDir ) );
final MessageLogger<AdvertisedSocketAddress> messageLogger;
if ( config.get( CoreEdgeClusterSettings.raft_messages_log_enable ) )
{
messageLogger = new BetterMessageLogger<>( myself.getRaftAddress(), raftMessagesLog( storeDir ) );
}
else
{
messageLogger = new NullMessageLogger<>();
}

LoggingOutbound<AdvertisedSocketAddress> loggingOutbound = new LoggingOutbound<>(
senderService, myself.getRaftAddress(), messageLogger );
Expand Down

0 comments on commit cafb75f

Please sign in to comment.