09 2021 档案

摘要:【参考】 https://github.com/citusdata/pg_auto_failover https://zhuanlan.zhihu.com/p/337259025 【环境】 paf1:189 paf2:204 paf3:202 【主要流程】 hostnamectl set-hostn 阅读全文
posted @ 2021-09-30 00:25 stupidstan2019 阅读(271) 评论(0) 推荐(0)
摘要:【原文】 https://www.cnblogs.com/study-everyday/p/8629100.html 【解决的问题】 1)使用hash%n,增加节点,全部数据都要改变 在一致性hash环上,增加一个节点x,只影响逆时针一个节点 减少一个节点,影响顺时针下一个节点 2)节点数少,只有2 阅读全文
posted @ 2021-09-29 19:20 stupidstan2019 阅读(48) 评论(0) 推荐(0)
摘要:CREATE NODE GROUP ngrp3 WITH (dn1,dn2); CREATE TABLE testgrp3 (id int primary key, note text) DISTRIBUTE BY HASH(id) TO GROUP ngrp3; insert into testg 阅读全文
posted @ 2021-09-29 00:52 stupidstan2019 阅读(127) 评论(0) 推荐(0)
摘要:【测试环境】 CREATE NODE GROUP ngrp2 WITH (dn1); CREATE TABLE testgrp2 (id int primary key, note text) DISTRIBUTE BY HASH(id) TO GROUP ngrp2; insert into te 阅读全文
posted @ 2021-09-29 00:42 stupidstan2019 阅读(44) 评论(0) 推荐(0)
摘要:1)插入n条数据 insert into test values(3, 'text'); 2)调用链 320行第一次为0,第二次为1 3)实现原理 3.1)roundRobinNode是一个链表 3.2)如果下一个元素不是队尾,取值 如果是队尾,取队头,顺序遍历 阅读全文
posted @ 2021-09-29 00:21 stupidstan2019 阅读(86) 评论(0) 推荐(0)
摘要:int main(){ int i=0; for(;i<200000;i++){ char *p = new char[1000 * 1000 * 1000]; } cout<<"i="<<i<<endl; } ./b terminate called after throwing an insta 阅读全文
posted @ 2021-09-23 00:53 stupidstan2019 阅读(76) 评论(0) 推荐(0)
摘要:1)映射配置 2)debug配置 注意再次配置mapping yum install gdb-gdbserver -y gdbserver :1234 --attach 3876 阅读全文
posted @ 2021-09-22 20:39 stupidstan2019 阅读(74) 评论(0) 推荐(0)
摘要:参考 https://blog.csdn.net/zhaowenzhong/article/details/109186011 测试前 集群一个dn节点 initgtm -Z gtm -D /home/postgres/data/gtm initdb -D /home/postgres/data/c 阅读全文
posted @ 2021-09-22 00:19 stupidstan2019 阅读(108) 评论(0) 推荐(0)
摘要:【参考】https://github.com/postgres-x2/postgres-x2https://blog.csdn.net/u014539401/article/details/69733928 【环境流程】git clone https://github.com.cnpmjs.org/ 阅读全文
posted @ 2021-09-22 00:03 stupidstan2019 阅读(115) 评论(0) 推荐(0)
摘要:【基础版】 一个gtm,一个cn,一个dn 【参考】 https://www.cnblogs.com/lottu/p/5646486.html 本地配置 F:\2021\typora总结\postgres-xl 阅读全文
posted @ 2021-09-21 01:00 stupidstan2019 阅读(34) 评论(0) 推荐(0)
摘要:【参考】 http://mysql.taobao.org/monthly/2015/10/04/ 【walreceiver线程】 收消息,wal消息的头是‘w’,写xlog 调用xlogWrite写入xlog 【startup线程】 收到消息apply调用栈,跟启动过程是一个for循环 阅读全文
posted @ 2021-09-20 21:35 stupidstan2019 阅读(45) 评论(0) 推荐(0)
摘要:【原文】 https://blog.csdn.net/yeruby/article/details/49004329 【笔记】 XL:eXtensible Lattice 1994年,Postgre95发布,开源。1996年,PostgreSQL继承了Postgre95,发布。2010年,Postg 阅读全文
posted @ 2021-09-20 20:50 stupidstan2019 阅读(265) 评论(4) 推荐(0)
摘要:【调用栈】 【调用sendFile接口发送文件】 pq_putmessage('d', buf, cnt) 都是直接读文件内容 阅读全文
posted @ 2021-09-20 20:44 stupidstan2019 阅读(36) 评论(0) 推荐(0)
摘要:【协议流程】 【服务端看接口】 1)SHOW wal_segment_size 2)IdentifySystem 系统标识 timeline wal location databaseName 3)BASE_BACKUP LABEL 'pg_basebackup base backup' NOWAI 阅读全文
posted @ 2021-09-20 20:30 stupidstan2019 阅读(392) 评论(0) 推荐(0)
摘要:【环境】zhuji 192.168.3.139beiji 192.168.3.204create user repuser with login replication password '123456'; 【主机】1)修改pg_hba.conf host replication repuser 1 阅读全文
posted @ 2021-09-20 16:47 stupidstan2019 阅读(170) 评论(0) 推荐(0)
摘要:【测试方法】 insert into t1(id) values(1); 杀进程 【dump日志】 【回放逻辑】 1)获取checkpoint点 2)从checkpoint点后循环读record 3)回放 调用栈 4)内部逻辑 【RmgrTable23种类型】 阅读全文
posted @ 2021-09-20 13:00 stupidstan2019 阅读(50) 评论(0) 推荐(0)
摘要:【测试方法】 insert into t1 select generate_series(1,227);postgres=# insert into t1 select generate_series(1,227); INSERT 0 227文件16KB postgres=# select pg_r 阅读全文
posted @ 2021-09-20 11:48 stupidstan2019 阅读(34) 评论(0) 推荐(0)
摘要:【结构】 【插入变化】 阅读全文
posted @ 2021-09-20 11:25 stupidstan2019 阅读(30) 评论(0) 推荐(0)
摘要:【测试方法】 insert into t1(id) values(2); update t1 set id=3; 执行vacuum t1; 【测试结果】 第一行 lp->lp_off :从8128变为8160 【代码入口】 compactify_tuples 阅读全文
posted @ 2021-09-20 11:24 stupidstan2019 阅读(44) 评论(0) 推荐(0)
摘要:【测试方法】 begin; select 1; 【snapshotData判断字段】 xmin, xmax 【代码】 [当前session] 开启事务后,第一个语句触发创建快照 入口函数:GetTransactionSnapshot 1)先生成快照 2)调用push,放到memoryContex里 阅读全文
posted @ 2021-09-20 10:04 stupidstan2019 阅读(82) 评论(0) 推荐(0)
摘要:【测试方法】 插入一行数据 session1:开启事务,更新这一行,不提交 session2:select * from t1; 【代码过程】 HeapTupleSatisfiesMVCC函数 1)session1能看到第二行 1.1) 1015行,TransactionIdIsCurrentTra 阅读全文
posted @ 2021-09-20 01:25 stupidstan2019 阅读(99) 评论(0) 推荐(0)
摘要:【调用入口】 【整体流程】 1)生成tuple对象 一共28字节 2)找到page和指定行 3)拷贝数据到page里 4)插入wal日志 【数据内容】 图示 【参考】 https://blog.csdn.net/postgres20/article/details/63290072 阅读全文
posted @ 2021-09-19 22:15 stupidstan2019 阅读(187) 评论(0) 推荐(0)
摘要:【tuple结构代码】 计算t_bits offset看上去应该是32,结果是23 【相关逻辑】 1) (type*)0 一个 type 类型的NULL指针用这个指针访问结构体内的成员是非法的 2)&(((type*)0)->field)计算 field 的地址 ,编译器不会产生访问 field 的 阅读全文
posted @ 2021-09-19 16:46 stupidstan2019 阅读(288) 评论(0) 推荐(0)
摘要:【调用栈】 【业务逻辑】 【数据结构】 【参考】 https://zhuanlan.zhihu.com/p/100424042 阅读全文
posted @ 2021-09-19 10:59 stupidstan2019 阅读(39) 评论(0) 推荐(0)
摘要:yum install -y cloc cloc oceanbase 1)mysql 273w行头文件 154w行c++文件 其中boost目录 181w行头文件 2)pg11 92w行代码 头文件13w行 polardb,94w行代码,只多2万行 2.1)polardb 3)oceanbase 阅读全文
posted @ 2021-09-12 20:20 stupidstan2019 阅读(616) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/cuichao1900/article/details/100394801 ExecVacuum->vacuum->vacuum_rel->heap_vacuum_rel->lazy_scan_heap->lazy_vacuum_index函数的实现逻辑, 阅读全文
posted @ 2021-09-03 00:17 stupidstan2019 阅读(145) 评论(0) 推荐(0)
摘要:pg_dump -h 127.0.0.1 -U jiang postgres > databasename.bak psql -h localhost -U jiang -d postgres < databasename.bak databasename.bak底部内容COPY public.t1 阅读全文
posted @ 2021-09-03 00:15 stupidstan2019 阅读(117) 评论(0) 推荐(0)