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
ISPN-8726 Memcached connector rewrite #10655
ISPN-8726 Memcached connector rewrite #10655
Conversation
bb20468
to
c831a76
Compare
b47230a
to
e54610b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review for the authentication and single port commit
server/core/src/main/java/org/infinispan/server/core/MagicByteDetector.java
Outdated
Show resolved
Hide resolved
b8fd3b1
to
acf1d3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got through a part of the files. Will need to look at the rest tomorrow.
server/memcached/src/main/java/org/infinispan/server/memcached/MemcachedAutoDetector.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryResponse.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryResponse.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryResponse.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryHeader.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryCommand.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/MemcachedTextDetector.java
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/MemcachedStats.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/MemcachedBaseDecoder.java
Outdated
Show resolved
Hide resolved
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryOpDecoder.java
Outdated
Show resolved
Hide resolved
a17d23a
to
d3204f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not look at every file, but I think I got the important ones. Many are just minor refactorings. Nothing really problematic other than the small bug in the Intrinsics. Most things are suggestions for optimizations.
core/src/test/java/org/infinispan/encoding/impl/EncoderWrappingTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/infinispan/encoding/impl/EncoderWrappingTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/infinispan/encoding/impl/EncoderWrappingTest.java
Outdated
Show resolved
Hide resolved
server/core/src/main/java/org/infinispan/server/core/MagicByteDetector.java
Outdated
Show resolved
Hide resolved
@@ -13,6 +13,6 @@ public class MemcachedBlockHoundIntegration implements BlockHoundIntegration { | |||
|
|||
@Override | |||
public void applyTo(BlockHound.Builder builder) { | |||
builder.allowBlockingCallsInside(MemcachedTestingUtil.class.getName() + "$2", "getDecoder"); | |||
//builder.allowBlockingCallsInside(MemcachedTestingUtil.class.getName() + "$2", "getDecoder"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just go ahead and delete the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
*/ | ||
@Override | ||
public boolean isTraceEnabled() { | ||
return (true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the parenthesis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird! Done
ByteBuf buf = channel.alloc().ioBuffer(); | ||
buf.writeBytes(STORED); | ||
channel.writeAndFlush(buf); | ||
channel.pipeline().replace("decoder", "decoder", new TextOpDecoderImpl(server, subject)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we 100% sure the client may not send another command on the socket before receiving the STORED response? I worry because it would be possible to process those commands before the new decoder is put in place causing other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The authentication section in the protocol doc doesn't really say much. How would we protected against such an eventuality ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only way I know is not to process the next command until the previous one is completed like we are doing in RESP. But this could be a non issue, I was just curious if you knew.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking a little more about this: authentication is a synchronous thing. Let's leave it like that and in case a client behaves weirdly we can go back on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, np.
server/memcached/src/main/java/org/infinispan/server/memcached/binary/BinaryAuthDecoder.java
Show resolved
Hide resolved
* @since 15.0 | ||
**/ | ||
public class MemcachedStats { | ||
public static final AtomicLongFieldUpdater INCR_MISSES = newUpdater(MemcachedStats.class, "incrMisses"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static final AtomicLongFieldUpdater INCR_MISSES = newUpdater(MemcachedStats.class, "incrMisses"); | |
public static final AtomicLongFieldUpdater<MemcachedStats> INCR_MISSES = newUpdater(MemcachedStats.class, "incrMisses"); |
and the following fields to remove some warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
d3204f4
to
c48f083
Compare
c48f083
to
9e2d2fb
Compare
@wburns repushed |
9e2d2fb
to
beec1cd
Compare
beec1cd
to
f54db58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, needs rebase though
f54db58
to
6c87bfe
Compare
Looks like there are some related test failures https://ci.infinispan.org/job/Infinispan/job/PR-10655/20/, especially the leaked threads |
641a267
to
6f4712f
Compare
Authentication tests started failing now :( |
Yes, it's an issue with the memcached client. Investigating |
* use our protocol parser generator * implement both the text and binary protocol * implement SASL authentication * implement text authentication * implement automatic protocol detection * enable memcached by default ISPN-13548 Allow cache expiration for Memcached
6f4712f
to
949a903
Compare
CI looks much much better now :) |
Integrated into main, thanks @tristantarrant ! |
https://issues.redhat.com/browse/ISPN-8726
https://issues.redhat.com/browse/ISPN-13548