Confusion regarding badger settings

I’m looking to set up a collaborative cluster and I’ve been reading through the documentation. I’m stuck on the part that says,

Set Badger to “file loading mode”: If you expect users joining your cluster from low-memory devices (1GB RAM or less), be sure to set table_loading_mode and value_log_loading_mode to 0 in the badger section in the configuration you distribute for those peers.

My confusion stems from how this sentence is structured. The colon and the ‘if’ clause is throwing me for a loop.

Is the part before the colon what I should do if the following ‘if’ clause evaluates as true?

Is it OK to skip this entire bullet point if follower peers have over than 1GB RAM?

What do table_loading_mode and value_log_loading_mode actually do? (What am I doing when I’m changing the 2 to a 0?) I couldn’t even find those strings when I searched the badger source code.

0 means “File Loading Mode”. This means badger will leave things on disk and read from disk directly rather than putting things on ram (or mmap them).

It is usually ok to skip this bullet point and go with defaults. Followers could always override via env-vars.

Docs would be here: badger package - - Go Packages

1 Like