Skip to content

Commit

Permalink
implement getKS(id, seq) - wow. Gate with empty check on reconcile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Jan 17, 2024
1 parent 7a71d6d commit ee0aeae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,15 @@ private void handle(Optional<Reconcile> result,
}
Reconcile gossip = result.get();
buffer.receive(gossip.getUpdatesList());
destination.link()
.update(ReconcileContext.newBuilder()
.setRing(destination.ring())
.addAllUpdates(buffer.reconcile(BloomFilter.from(gossip.getDigests()),
destination.member().getId()))
.build());
var biff = gossip.getDigests();
if (!Biff.getDefaultInstance().equals(biff)) {
destination.link()
.update(ReconcileContext.newBuilder()
.setRing(destination.ring())
.addAllUpdates(buffer.reconcile(BloomFilter.from(biff),
destination.member().getId()))
.build());
}
} finally {
if (timer != null) {
timer.stop();
Expand Down Expand Up @@ -403,9 +406,9 @@ public class Service implements Router.ServiceRouting {
public Reconcile gossip(MessageBff request, Digest from) {
Member predecessor = context.ring(request.getRing()).predecessor(member);
if (predecessor == null || !from.equals(predecessor.getId())) {
log.info("Invalid inbound messages gossip on {}:{} from: {} on ring: {} - not predecessor: {}",
context.getId(), member.getId(), from, request.getRing(),
predecessor == null ? "<null>" : predecessor.getId());
log.trace("Invalid inbound messages gossip on {}:{} from: {} on ring: {} - not predecessor: {}",
context.getId(), member.getId(), from, request.getRing(),
predecessor == null ? "<null>" : predecessor.getId());
return Reconcile.getDefaultInstance();
}
return Reconcile.newBuilder()
Expand Down
6 changes: 5 additions & 1 deletion thoth/src/main/java/com/salesforce/apollo/thoth/KerlDHT.java
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,11 @@ public KeyState_ getKeyState(EventCoords coordinates) {

@Override
public KeyState_ getKeyState(Ident identifier, long sequenceNumber) {
return null;
if (log.isTraceEnabled()) {
log.trace("get key state for {}:{} on: {}", Identifier.from(identifier), ULong.valueOf(sequenceNumber),
member.getId());
}
return complete(k -> k.getKeyState(identifier, sequenceNumber));
}

@Override
Expand Down

0 comments on commit ee0aeae

Please sign in to comment.