Kyorai / riak_core

Distributed systems infrastructure used by Riak.
Apache License 2.0
101 stars 23 forks source link

Prevent handoff ip to be local causing problems with devrel builds #30

Closed ghost closed 3 years ago

ghost commented 6 years ago

Hi,

I've commented on the commit itself but in case it gets lost - I'm having difficulties with this new restriction - it makes running devrel instances on OSX tricky - 127.1.0.1, etc are not valid IP addresses, at least on High Sierra. Specifically when trying to work with Tanodb.

https://github.com/Kyorai/riak_core/commit/40c5131ea23b96881ee5e1700d2105267ea15472

Licenser commented 6 years ago

The handoff IF cannot be set to localhost to prevent data loss. If the ip end up as 127.0.0.1 nodes might end up handing off data to themselves, then deleting themselves after the handoff.

I understand the issue but "Won't delete data in production" trumps "development convenience" in my opinion. There are a few solutions around this issue in dev, if osx doesn't like 127.1.0.1 any more an alternative is specifying your interface ip. If you want to automate that you can grab your ip via ifconfig en0 | grep 'inet ' | cut -d ' ' -f 2

ghost commented 6 years ago

@marianoguerra Still tripping up everyone who I try to get going on the "Little Riak Core" book.

marianoguerra commented 6 years ago

@bryanhuntesl this is a riak_core schema, I only reference riak_core as a dependency, can't do much if this is not merged into a released riak_core_ng

I don't want to carry a riak_core schema on my template or override it somehow.

@Licenser maybe a way to set a flag "danger_allow_local_handoff_ip", which is false by default and I can override?

marianoguerra commented 6 years ago

I can print a warning on start if that flag is set saying "do not use in production!"

Licenser commented 6 years ago

the danger_allow_local_handoff_ip is a good idea!

ghost commented 6 years ago

@Licenser - I worked support for Basho, 2 years, and this was never an issue 😂 - if there's an issue it needs to be addressed higher up the food chain. It's a hurdle that requires a hack and explanation every time I attempt to train anyone on how to build apps on riak_core

ghost commented 6 years ago

Really the issue is the lackluster basho implementation that didn't check where it was sending/receiving from :-D

Licenser commented 6 years ago

agreed that's the real issue, but not allowing that to be set was the quick fix :P! It's still better than having a setting that when (for whatever reason) set to 127.0.0.1 will delete your data.

Licenser commented 6 years ago

PS: I did run into that problem and it took me way to long to figure out what happens with a handoff of 127.0.0.1

llelf commented 5 years ago

@bryanhuntesl if it helps, on Mac you can do ifconfig lo0 alias 127.1.0.1 (it will persist even after restart, as far as I understand).