Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repair Increment full gc #883

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

/**
* @author Slight
*
* Make sure to execute this command on stateThread.
* Jan 31, 2022 1:06 PM
*/
Expand Down Expand Up @@ -44,7 +43,7 @@ public SequenceCommand(Collection<SequenceCommand<?>> pasts, Command<V> inner, E

private void executeSelf() {
CommandFuture<V> future = inner.execute(workerThreads);
future.addListener((f)->{
future.addListener((f) -> {
if (f.isSuccess()) {
stateThread.execute(() -> {
try {
Expand All @@ -65,10 +64,13 @@ private void executeSelf() {
}

private void nextAfter(Collection<SequenceCommand<?>> pasts) {
for (SequenceCommand<?> past : pasts) {
past.future().addListener((f)->{
final int size = pasts.size();
List<SequenceCommand> temp = Lists.newArrayList(pasts);
for (SequenceCommand<?> past : temp) {
past.future().addListener((f) -> {
if (f.isSuccess()) {
if (++complete == pasts.size()) {
pasts.remove(past);
if (++complete == size) {
executeSelf();
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private void submitNoneKeyCommand(RedisOpCommand<?> command, long commandOffset)

/* do some stuff when finish */

releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());
increaseOffsetWhenSuccess(current, commandOffset);
releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());

/* run self */

Expand Down Expand Up @@ -189,8 +189,8 @@ private void submitSingleKeyCommand(RedisOpDataCommand<?> command, long commandO

/* do some stuff when finish */

releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());
increaseOffsetWhenSuccess(current, commandOffset);
releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());

/* run self */

Expand All @@ -212,8 +212,8 @@ private void submitMultiKeyCommand(RedisOpDataCommand<?> command, long commandOf
forgetWhenDone(current, key);
}

releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());
increaseOffsetWhenSuccess(current, commandOffset);
releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());

current.execute();
}
Expand All @@ -240,8 +240,8 @@ private void submitObstacle(RedisOpCommand<?> command, long commandOffset) {

/* do some stuff when finish */

releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());
increaseOffsetWhenSuccess(current, commandOffset);
releaseMemoryThresholdWhenDone(current, command.redisOp().estimatedSize());

/* run self */

Expand All @@ -266,7 +266,7 @@ private void forgetWhenDone(SequenceCommand<?> sequenceCommand, RedisKey key) {


private void releaseMemoryThresholdWhenDone(SequenceCommand<?> sequenceCommand, long memory) {
sequenceCommand.future().addListener((f)->{
sequenceCommand.future().addListener((f) -> {
concurrencyThreshold.release();
memoryThreshold.release(memory);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void onRdbData(ByteBuf rdbData) {

@Override
public void endReadRdb(EofType eofType, GtidSet emptyGtidSet, long rdbOffset) {
logger.info("[endReadRdb] eofType={}", eofType);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected RedisKeeperServer startRedisKeeperServer(int replicationStoreCommandFi
commandFileSize,
replicationStoreCommandFileNumToKeep,
replicationStoreMaxCommandsToTransferBeforeCreateRdb, minTimeMilliToGcAfterCreate);

((TestKeeperConfig)keeperConfig).setRdbDumpMinIntervalMilli(0);
RedisKeeperServer redisKeeperServer = createRedisKeeperServer(keeperConfig);
redisKeeperServer.initialize();
redisKeeperServer.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testReplicationData() throws Exception{
@Test
public void testNewDumpCommandsLost() throws Exception{

startKeeperServerAndTestReFullSync(2, allCommandsSize);
startKeeperServerAndTestReFullSync(1, allCommandsSize);
}

@Test
Expand Down
Loading