Skip to content

Commit

Permalink
Log Segment: Refactor + Bug Fixes (#3532)
Browse files Browse the repository at this point in the history
The purpose of this refactor is decouple segment related code
(implementation/encoding) from StreamLogFiles which operates
logically on segments and isn't concerned with low level
implementation.

Additionally, this patch fixes bugs related to reference counting
and logging and adds more determinism to the flushing logic.
Flushing dirty segments will now happen in FIFO order with respect
to the logic addresses (i.e., sequence numbers).
  • Loading branch information
Maithem committed Mar 10, 2023
1 parent 00e5afa commit 0266547
Show file tree
Hide file tree
Showing 19 changed files with 1,053 additions and 1,079 deletions.
3 changes: 1 addition & 2 deletions Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Options:
-d <level>, --log-level=<level> Set the logging level, valid levels are:
ERROR,WARN,INFO,DEBUG,TRACE [default: INFO].
-Q, --quickcheck-test-mode Run in QuickCheck test mode
-M <address>:<port>, --management-server=<address>:<port> Layout endpoint to seed Management Server
-n, --no-verify Disable checksum computation and verification.
-M <address>:<port>, --management-server=<address>:<port> Layout endpoint to seed Management Server
-e, --enable-tls Enable TLS.
-u <keystore>, --keystore=<keystore> Path to the key store.
-f <keystore_password_file>, --keystore-password-file=<keystore_password_file> Path to the file containing the key store password.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ public class CorfuServer {
+ " Set the logging level, valid levels are: \n"
+ " "
+ " ALL,ERROR,WARN,INFO,DEBUG,TRACE,OFF [default: INFO].\n"
+ " -n, --no-verify "
+ " Disable checksum computation and verification.\n"
+ " -N, --no-sync "
+ " Disable syncing writes to secondary storage.\n"
+ " -A, --no-auto-commit "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ public static class LogUnitServerConfig {
private final double cacheSizeHeapRatio;
private final long maxCacheSize;
private final boolean memoryMode;
private final boolean noVerify;
private final boolean noSync;

/**
Expand All @@ -593,7 +592,6 @@ public static LogUnitServerConfig parse(Map<String, Object> opts) {
.cacheSizeHeapRatio(cacheSizeHeapRatio)
.maxCacheSize((long) (Runtime.getRuntime().maxMemory() * cacheSizeHeapRatio))
.memoryMode(Boolean.parseBoolean(opts.get("--memory").toString()))
.noVerify((Boolean) opts.get("--no-verify"))
.noSync((Boolean) opts.get("--no-sync"))
.build();
}
Expand All @@ -612,7 +610,7 @@ StreamLog buildInMemoryStreamLog(@Nonnull BatchProcessorContext batchProcessorCo
StreamLog buildStreamLog(@Nonnull LogUnitServerConfig config,
@Nonnull ServerContext serverContext,
@Nonnull BatchProcessorContext batchProcessorContext) {
return new StreamLogFiles(serverContext, config.isNoVerify(), batchProcessorContext);
return new StreamLogFiles(serverContext, batchProcessorContext);
}

LogUnitServerCache buildLogUnitServerCache(@Nonnull LogUnitServerConfig config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@
* Created by maithem on 3/14/17.
*/
public class AddressMetaData {
public final int checksum;
public final int length;
public final long offset;

/**
* Returns a metadata object for an address.
*
* @param checksum checksum of log data
* @param length length of log data
* @param offset file channel offset
**/
public AddressMetaData(int checksum, int length, long offset) {
this.checksum = checksum;
public AddressMetaData(int length, long offset) {
this.length = length;
this.offset = offset;
}
Expand Down

0 comments on commit 0266547

Please sign in to comment.