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

Multi get, pluggable hashing and some code cleanup (#1) #145

Closed
wants to merge 91 commits into from

Conversation

blackmad
Copy link

This change implements multi-get, pluggable hashing and some (but not complete) code cleanup

pluggable hashing

  • removes the failover options which would be hard to make work with pluggable hashing (if this is important to keep, I will figure out a way to add it back)
  • implemented with the idea in mind of being able to use https://www.npmjs.com/package/hashring
  • lots of tests added!

code cleanup

  • move to tap v14 so tap.only works
  • introduce a constants file, change most (but not all) magic numbers in memjs to use named constants
  • start using "server" in many places rather than "serv"

I'd really like to move the eslint version forward so we can use const, let, =>, and array destructuring, but that seemed like it would be better suited to a separate PR

@saschat
Copy link
Member

saschat commented Mar 29, 2021

Hey @blackmad, thanks so much for all the work.

I have only looked at the pluggable hash function so far.

I don't think removing failover is a good idea for a couple of reasons.

  • Without failover, you will be dogpiling servers whenever there is an issue... and in the cloud, there is always an issue eventually.
  • For MemCachier caches, servers have a consistent view of the cache, so failovers are highly desirable since you will get the same answer from any server.

The good thing is that I don't think it is hard to keep failover at all. For the default function, you can just leave the "use next server" failover. Personally, I would also recommend the same failover for hashring as it is common practice. Btw. feel free to add the hashring function to choose a server to memjs in a future PR as well. I think @alevy has a TODO about adding one in the code anyway. The good thing about having both in memjs is that you can reuse the "use next server" failover.

@blackmad
Copy link
Author

blackmad commented Mar 29, 2021 via email

@tarwin
Copy link

tarwin commented Sep 13, 2021

Is the pluggable Hash going to be rolled into the main branch anytime soon? I'd love to be able to use this but need to write our own Hash support at the moment (horrible old PHP memcache compatible CRC32 hash urgh).

@saschat
Copy link
Member

saschat commented Sep 28, 2021

@blackmad any update? Have you thought about the 3 options above?

arturoolvera and others added 27 commits February 6, 2023 09:42
Auto Reconnect when socket is closed
Previous behavior was to hang forever on unexpected close or unhandled
error response.
…-many-conns

Error out waiting clients on close, handle too many connections
…onnect

Reset responseBuffer on error, close, and new connections
bump version to clear circleCI cache
Add versionAllWithErrors to return info on which hosts succeeded or failed
Unifies error handling/resetting state in error()
@blackmad blackmad closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants