即使对于 -11!(-2;`path) 也出现 wsfull 错误时如何重播 TP 日志文件
How to replay the TP log file when getting wsfull error even for -11!(-2;`path)
即使尝试使用以下方法从 TPlog 文件中获取消息计数,我也会收到 wsfull 错误:
-11!(-2;`:/uts/tplog_2020.07.07) /- wsfull
在这种情况下,我们如何获取 tplog 文件的计数?
在这种情况下,是否将消息以块的形式插入到仅分区选项以展开 tplog 文件?
编辑:
Kdb Version - 3.2
Log File size - 24G
Memory Stats -
q).Q.w[]
used| 35590543840
heap| 35500589056
peak| 35500589056
wmax| 0
mmap| 0
mphy| 270267080704
syms| 2807
symw| 158810
我试过了 运行:
upd:insert(Version 3.2)
-11!(1000000;`:/uts/tplog_2020.07.07); /- output 1000000
count trade /- output count from table - 88471241
-11!(2000000;`:/uts/tplog_2020.07.07); /- output 2000000
count trade/- output count from table - 88471241
-11!(3000000;`:/uts/tplog_2020.07.07); /- wsfull
Tried with version 4.0
-11!(-2;`:/uts/tplog_2020.07.07); /- type error
当我尝试从 table 获取最后几条消息时,它会抛出 'Segmentation Fault'
-11!(1000000;`:/uts/tplog_2020.07.07); /- output - 88471241
-5#trade /- Segmentation Fault, session closed
我的第一个猜测是 tplog 文件已损坏。如果有人能告诉我如何从导致类型错误的 tplog 文件中获取错误消息,那将会很有帮助?
您使用的是哪个 KDB 版本?
在 4.0 中,他们为此添加了完整性检查。
“已将进一步的完整性检查添加到流式执行 -11!x 以避免 corrupted/incomplete 日志文件出现 wsfull 或段错误。”
根据评论中的讨论,我开始认为您将块写入日志文件的方式有些不对。重放 100 个块应该 return 100,重放 200 个块应该 return 200 个块(假设日志文件格式正确)。这是一个可用于检查单个块的函数:
{`counter set 0;.z.ps:{$[counter=desiredChunk;`savedChunk set x;counter+:1]};-11!(1+desiredChunk::y;x);.z.ps:{value x}}[`:tplog2020.07.01;5]
传递日志文件和要提取的块(第一个块从 0 开始)。一旦你 运行 这个你就会有一个全局变量“savedChunk”,它包含你的块并且你可以检查它。单个块应如下所示:
q)savedChunk
`upd
`myTable
(0D05:34:00.186409000;`foo;1.23;1234;1b;.....)
/or if you write to the tplog in batches it could look like:
q)savedChunk
`upd
`myTable
(0D05:34:00.186409000 0D05:34:00.186409000;`foo`bar;1.23 4.56;1234 5678;10b;.....)
我会查看您的块,从块零开始,看它们是否格式正确。然后查看 chunk 12683 看看是否有什么不对的地方。
您的块是否可能包含多个 upd/table? (这将是我以前从未见过的自定义实现)。
即使尝试使用以下方法从 TPlog 文件中获取消息计数,我也会收到 wsfull 错误:
-11!(-2;`:/uts/tplog_2020.07.07) /- wsfull
在这种情况下,我们如何获取 tplog 文件的计数?
在这种情况下,是否将消息以块的形式插入到仅分区选项以展开 tplog 文件?
编辑:
Kdb Version - 3.2
Log File size - 24G
Memory Stats -
q).Q.w[]
used| 35590543840
heap| 35500589056
peak| 35500589056
wmax| 0
mmap| 0
mphy| 270267080704
syms| 2807
symw| 158810
我试过了 运行:
upd:insert(Version 3.2)
-11!(1000000;`:/uts/tplog_2020.07.07); /- output 1000000
count trade /- output count from table - 88471241
-11!(2000000;`:/uts/tplog_2020.07.07); /- output 2000000
count trade/- output count from table - 88471241
-11!(3000000;`:/uts/tplog_2020.07.07); /- wsfull
Tried with version 4.0
-11!(-2;`:/uts/tplog_2020.07.07); /- type error
当我尝试从 table 获取最后几条消息时,它会抛出 'Segmentation Fault'
-11!(1000000;`:/uts/tplog_2020.07.07); /- output - 88471241
-5#trade /- Segmentation Fault, session closed
我的第一个猜测是 tplog 文件已损坏。如果有人能告诉我如何从导致类型错误的 tplog 文件中获取错误消息,那将会很有帮助?
您使用的是哪个 KDB 版本?
在 4.0 中,他们为此添加了完整性检查。
“已将进一步的完整性检查添加到流式执行 -11!x 以避免 corrupted/incomplete 日志文件出现 wsfull 或段错误。”
根据评论中的讨论,我开始认为您将块写入日志文件的方式有些不对。重放 100 个块应该 return 100,重放 200 个块应该 return 200 个块(假设日志文件格式正确)。这是一个可用于检查单个块的函数:
{`counter set 0;.z.ps:{$[counter=desiredChunk;`savedChunk set x;counter+:1]};-11!(1+desiredChunk::y;x);.z.ps:{value x}}[`:tplog2020.07.01;5]
传递日志文件和要提取的块(第一个块从 0 开始)。一旦你 运行 这个你就会有一个全局变量“savedChunk”,它包含你的块并且你可以检查它。单个块应如下所示:
q)savedChunk
`upd
`myTable
(0D05:34:00.186409000;`foo;1.23;1234;1b;.....)
/or if you write to the tplog in batches it could look like:
q)savedChunk
`upd
`myTable
(0D05:34:00.186409000 0D05:34:00.186409000;`foo`bar;1.23 4.56;1234 5678;10b;.....)
我会查看您的块,从块零开始,看它们是否格式正确。然后查看 chunk 12683 看看是否有什么不对的地方。
您的块是否可能包含多个 upd/table? (这将是我以前从未见过的自定义实现)。