且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Redis 6.0.8 紧急发布,请尽快升级!

更新时间:2022-08-22 13:32:37

Redis 6.0.8 紧急发布,请尽快升级!

Redis 6.0.8 紧急发布,请尽快升级!

Redis 6.0.8 发布邮件:

https://groups.google.com/g/redis-db/c/Wmf0RB25PmY/m/d7hVkerfBQAJ

以下是主要内容预览:

Redis 6.0.8 紧急发布,请尽快升级!

难道 Redis 出现了严重漏洞不成?栈长来解读一下这封邮件内容!


除了以上提到的受影响的内容之外,还有以下三方面的更新:


1、问题修复:


通过 Redis 的 CONFIG SET 命令设置 oom-score-adj-values 参数值,或者通过在配置文件中加载的时候,将生成一个损坏的配置文件导致 Redis 启动失败;(好吧!不是漏洞,是 Redis 的一个 bug 而已!)

修改 MacOS 系统下一个 redis-cli --pipe 使用问题;

修复了当不存在的键时,使用 HKEYS/HVALS 命令的响应问题;

其他各种小错误的修复;

2、新特性/改变


移除设置 madvise 时的 THP 警告;

允许在集群的只读副本上执行读取命令;

为 redis-cli --cluster 命令增加 masters/replicas 选项;

3、模块API


增加 RedisModule_ThreadSafeContextTryLock 模块(线程安全的锁);

重点来看一下这个导致重大问题的 oom-score-adj-values 参数的用处:


https://github.com/redis/redis/pull/1690/files

############################ KERNEL OOM CONTROL ##############################

# On Linux, it is possible to hint the kernel OOM killer on what processes
# should be killed first when out of memory.
#
# Enabling this feature makes Redis actively control the oom_score_adj value
# for all its processes, depending on their role. The default scores will
# attempt to have background child processes killed before all others, and
# replicas killed before masters.

oom-score-adj no

# When oom-score-adj is used, this directive controls the specific values used
# for master, replica and background child processes. Values range -1000 to
# 1000 (higher means more likely to be killed).
#
# Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities)
# can freely increase their value, but not decrease it below its initial
# settings.
#
# Values are used relative to the initial value of oom_score_adj when the server
# starts. Because typically the initial value is 0, they will often match the
# absolute values.

oom-score-adj-values 0 200 800

这个 oom-score-adj 参数是用来 Linux 内核控制调优的,在 Linux 系统中,当内存溢出时,可以提示内核 OOM killer 应该首先杀死哪些进程。


默认 oom-score-adj-values 不设置的情况下会优先杀死后台子进程,然后主从节点优先优先杀死从节点。


所以这 3 个值分别用来设置主、从、后台子进程的分值的,分值范围从 -1000 ~ 1000,分值越高越有可能被先杀死。


PS: 软件嘛,总避免不了bug,所以,各位开发、运维的同学,如果有用到这个的,请尽快升级保平安。


最后,欢迎大家关注微信公众号:Java技术栈,可以阅读栈长我写的往期 Redis 系列教程,后续更多干货陆续奉上。


觉得有用,欢迎在看、转发支持下,感谢了!