Add shard log compaction boundary
This commit is contained in:
parent
2ff82365cb
commit
901e980ca6
9 changed files with 190 additions and 11 deletions
|
|
@ -132,6 +132,20 @@ namespace GameCult.Networking
|
|||
};
|
||||
}
|
||||
|
||||
var compactedThrough = _database.GetCompactedMutationLogSequence(request.ShardId);
|
||||
if (request.AfterSequence < compactedThrough)
|
||||
{
|
||||
return new CultNetShardLogResponseMessage
|
||||
{
|
||||
MessageId = RequestMessageId(request.MessageId),
|
||||
ShardId = request.ShardId,
|
||||
ShardEpoch = shard.Epoch,
|
||||
ResyncRequired = true,
|
||||
Reason = "compacted_history",
|
||||
CompactedThrough = compactedThrough
|
||||
};
|
||||
}
|
||||
|
||||
var entries = _database.GetMutationLogMessages(request.ShardId, request.AfterSequence, request.Limit)
|
||||
.ToArray();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue