node evict

一、主机环境

OS REDHAT EL 6.6

 

二、故障现象:

 

一套系统4+6一体机集群出现驱逐实例故障:

 

主机yxfkdb2Grid alert日志在20161016日的1017分点,出现如下报警:

 

2016-10-16 10:17:18.871:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb1 (1) missing for 50% of timeout interval. Removal of this node from cluster in 14.540 seconds

2016-10-16 10:17:18.872:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb3 (3) missing for 50% of timeout interval. Removal of this node from cluster in 14.020 seconds

2016-10-16 10:17:18.872:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb4 (4) missing for 50% of timeout interval. Removal of this node from cluster in 14.700 seconds

2016-10-16 10:17:25.875:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb3 (3) missing for 75% of timeout interval. Removal of this node from cluster in 7.010 seconds

2016-10-16 10:17:26.876:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb1 (1) missing for 75% of timeout interval. Removal of this node from cluster in 6.530 seconds

2016-10-16 10:17:26.877:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb4 (4) missing for 75% of timeout interval. Removal of this node from cluster in 6.690 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb1 (1) missing for 90% of timeout interval. Removal of this node from cluster in 2.530 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb3 (3) missing for 90% of timeout interval. Removal of this node from cluster in 2.010 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb4 (4) missing for 90% of timeout interval. Removal of this node from cluster in 2.690 seconds

 

从日志中看到节点2与其他三个节点网络心跳丢失在规定的时间内会被驱逐,此情况多数为RAC私网心跳问题,但从oswatch中分析私有网络不存在异常;

 

三、故障原因分析

私有网络心跳丢失导致节点2驱逐;

2016-10-16 10:17:18.871:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb1 (1) missing for 50% of timeout interval. Removal of this node from cluster in 14.540 seconds

2016-10-16 10:17:18.872:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb3 (3) missing for 50% of timeout interval. Removal of this node from cluster in 14.020 seconds

2016-10-16 10:17:18.872:

[cssd(18931)]CRS-1612:Network communication with node yxfkdb4 (4) missing for 50% of timeout interval. Removal of this node from cluster in 14.700 seconds

2016-10-16 10:17:25.875:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb3 (3) missing for 75% of timeout interval. Removal of this node from cluster in 7.010 seconds

2016-10-16 10:17:26.876:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb1 (1) missing for 75% of timeout interval. Removal of this node from cluster in 6.530 seconds

2016-10-16 10:17:26.877:

[cssd(18931)]CRS-1611:Network communication with node yxfkdb4 (4) missing for 75% of timeout interval. Removal of this node from cluster in 6.690 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb1 (1) missing for 90% of timeout interval. Removal of this node from cluster in 2.530 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb3 (3) missing for 90% of timeout interval. Removal of this node from cluster in 2.010 seconds

2016-10-16 10:17:30.878:

[cssd(18931)]CRS-1610:Network communication with node yxfkdb4 (4) missing for 90% of timeout interval. Removal of this node from cluster in 2.690 seconds

 

在集群日志alertyxfkdb2.log出现节点心跳丢失,2号节点和13,4号无法通讯,30S2节点在2016-10-16 10:17:30.878:节点驱逐。

 

网络心跳丢失一般原因如下:

1、私网网络问题2OCCSD进程以及其子进程无法调度3OS BUG 4、数据库HANG

 

1、私网的心跳问题:通过部署了OSW

 zzz ***Sun Oct1610:10:12CST2016

tracerouteto172.16.131.33 (172.16.131.33),30hopsmax,60bytepackets

 1 yxfkdb1-priv2 (172.16.131.33) 0.067ms 0.055ms 0.047ms

tracerouteto172.16.131.37 (172.16.131.37),30hopsmax,60bytepackets

 1 yxfkdb3-priv2 (172.16.131.37) 0.073ms 0.087ms 0.102ms

tracerouteto172.16.131.39 (172.16.131.39),30hopsmax,60bytepackets

 1 yxfkdb4-priv2 (172.16.131.39) 0.071ms 0.060ms 0.071ms

zzz ***Sun Oct1610:10:17CST2016

tracerouteto172.16.131.33 (172.16.131.33),30hopsmax,60bytepackets

 1 yxfkdb1-priv2 (172.16.131.33) 0.067ms 0.060ms 0.071ms

tracerouteto172.16.131.37 (172.16.131.37),30hopsmax,60bytepackets

 1 yxfkdb3-priv2 (172.16.131.37) 0.107ms 0.096ms 0.089ms

tracerouteto172.16.131.39 (172.16.131.39),30hopsmax,60bytepackets

 1 yxfkdb4-priv2 (172.16.131.39) 0.097ms 0.092ms 0.090ms

zzz ***Sun Oct1610:10:22CST2016

tracerouteto172.16.131.33 (172.16.131.33),30hopsmax,60bytepackets

 1 yxfkdb1-priv2 (172.16.131.33) 0.075ms 0.061ms 0.062ms

tracerouteto172.16.130.37 (172.16.130.37),30hopsmax,60bytepackets

connect:Networkisunreachable

tracerouteto172.16.131.37 (172.16.131.37),30hopsmax,60bytepackets

 1 yxfkdb3-priv2 (172.16.131.37) 0.121ms 0.092ms 0.101ms

tracerouteto172.16.130.39 (172.16.130.39),30hopsmax,60bytepackets

可以看到私网通讯正常,没有丢包发生。

 

2OCCSD进程以及其子进程无法调度

在日志alertyxfkdb2.logocssd.log未发现not scheduled for等信息 

 

3、数据库HANG

可以看到AWRCPU消耗很低,等待事件均正常,且平均等待时间大多数在0毫秒。AAS不到2.

AWR中可以发现数据库CPU ,AAS等值均正常。

2Q==

 

ZZ

 DB ALERTGI ALERT中可以看到是先发生节点驱逐,后导致实例重启。

1.     DB ALERT

Sun Oct 16 10:17:35 2016

NOTE: ASMB terminating

Errors in file /opt/oracle/diag/rdbms/sbycfkdb/sbycfkdb2/trace/sbycfkdb2_asmb_37372.trc:

ORA-15064: communication failure with ASM instance

ORA-03113: end-of-file on communication channel

Process ID:

Session ID: 1770 Serial number: 7

Errors in file /opt/oracle/diag/rdbms/sbycfkdb/sbycfkdb2/trace/sbycfkdb2_asmb_37372.trc:

ORA-15064: communication failure with ASM instance

ORA-03113: end-of-file on communication channel

Process ID:

Session ID: 1770 Serial number: 7

ASMB (ospid: 37372): terminating the instance due to error 15064

Instance terminated by ASMB, pid = 37372

Sun Oct 16 10:19:05 2016

Starting ORACLE instance (normal)

 

GI ALERT

[cssd(18931)]CRS-1610:Network communication with node yxfkdb4 (4) missing for 90% of timeout interval. Removal of this node from cluster in 2.690 seconds

2016-10-16 10:17:33.861:

[cssd(18931)]CRS-1608:This node was evicted by node 3,

数据库HANG的问题可以排除。

 

4OS BUG

1.     6.6 REDHAT内核2.6.32-504.el6.x86_64中存在一个BUG,进程存在无故HANG的情况,BUG具体描述如下:

“The impact of this kernel bug is very simple: user processes can deadlock and hang in seemingly impossible situations. A futex wait call (and anything using a futex wait) can stay blocked forever, even though it had been properly woken up by someone. Thread.park() in Java may stay parked. Etc. If you are lucky you may also find soft lockup messages in your dmesg logs. If you are not that lucky (like us, for example), you'll spend a couple of months of someone's time trying to find the fault in your code, when there is nothing there to find.”

 

RHEL 6 (and CentOS 6, and SL 6): 6.0-6.5 are good. 6.6 is BAD. 6.6.z is good.

RHEL 7 (and CentOS 7, and SL 7): 7.1 is BAD. As of yesterday. there does not yet appear to be a 7.x fix.  [May 13, 2015]

RHEL 5 (and CentOS 5, and SL 5): All versions are good (including 5.11).

 

 

这个BUG描述,用户进程在看似不可能的情况下出现死锁或者夯住,影响的版本是6.67.1

 BUG的修复在6.6.z中已经修复。

 综上分析:此次节点驱逐定位到OSBUG,建议升级KERNEL来解决该问题。

 

四、解决办法

升级OS KERNEL解决OSBUG

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31134212/viewspace-2127487/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31134212/viewspace-2127487/

""" LRU缓存组模拟器 处理读写请求并根据LRU策略管理缓存置换,支持多组缓存 """ class CacheNode: def __init__(self, memory_index, next=None, prev=None, is_dirty=False): self.memory_index = memory_index # 内存块标识 self.next = next # 后驱节点 self.prev = prev # 前驱节点 self.is_dirty = is_dirty # 标记是否被修改 class LRUCacheGroup: def __init__(self, capacity): # 初始化双向链表头尾哨兵节点 self.dummy_head = CacheNode(-1) self.dummy_tail = CacheNode(-1) self.dummy_head.next = self.dummy_tail self.dummy_tail.prev = self.dummy_head self.cache_map = {} # 内存块索引 -> 节点映射 self.capacity = capacity # 组内最大缓存容量 self.current_size = 0 # 当前缓存数量 def _remove_node(self, node: CacheNode): """从链表中移除指定节点""" prev_node = node.prev next_node = node.next prev_node.next = next_node next_node.prev = prev_node def _insert_to_head(self, node: CacheNode): """将节点插入链表头部(最近使用位置)""" # 调整头节点和原首节点的指针 original_first = self.dummy_head.next self.dummy_head.next = node node.prev = self.dummy_head node.next = original_first original_first.prev = node def _move_to_head(self, node: CacheNode): """将已存在的节点移动到头部""" self._remove_node(node) self._insert_to_head(node) def _evict_last(self): """淘汰末尾节点(最久未使用),返回需要写回磁盘的操作""" evicted_node = self.dummy_tail.prev self.cache_map.pop(evicted_node.memory_index) self._remove_node(evicted_node) self.current_size -= 1 # 如果节点被修改过,需要写回磁盘 return [[1, evicted_node.memory_index]] if evicted_node.is_dirty else [] def _add_new_node(self, memory_index: int): """添加新节点到缓存组,触发置换逻辑""" operations = [] new_node = CacheNode(memory_index) self.cache_map[memory_index] = new_node self._insert_to_head(new_node) self.current_size += 1 # 超过容量时淘汰末尾节点 if self.current_size > self.capacity: operations.extend(self._evict_last()) # 记录缓存加载操作 operations.append([0, memory_index]) return operations def read_memory(self, memory_index): """处理读请求:命中则移动节点,未命中则加载""" if memory_index in self.cache_map: self._move_to_head(self.cache_map[memory_index]) return [] return self._add_new_node(memory_index) def write_memory(self, memory_index): """处理写请求:标记为脏数据,其余逻辑与读相同""" operations = [] # 未命中时先加载 if memory_index not in self.cache_map: operations.extend(self._add_new_node(memory_index)) else: self._move_to_head(self.cache_map[memory_index]) # 标记数据已被修改 self.cache_map[memory_index].is_dirty = True return operations # 主程序流程 if __name__ == "__main__": # 参数解析 group_size, group_count, query_count = map(int, input().split()) # 初始化所有缓存组(每组容量为group_size) cache_groups = [LRUCacheGroup(group_size) for _ in range(group_count)] output = [] for _ in range(query_count): operation_type, memory_index = map(int, input().split()) # 计算目标缓存组:按 (内存地址//组大小) % 组总数 的哈希策略 group_id = (memory_index // group_size) % group_count current_group = cache_groups[group_id] if operation_type == 0: # 读操作 operations = current_group.read_memory(memory_index) else: # 写操作 operations = current_group.write_memory(memory_index) # 收集操作结果 for op in operations: output.append(f"{op[0]} {op[1]}") # 输出所有操作记录 print("\n".join(output))使用c/c++改写代码
03-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值