在 kdb 中重放来自 TP 的日志文件时 RDB 和 TP 之间的消息计数差异
Difference in count of messages between RDB and TP while replaying the logfile from TP in kdb
参考 - https://code.kx.com/q/wp/rt-tick/#tickerplant-log-replay
The second argument to .u.rep is simpler and would look like:
q)y
11995
`:C:/OnDiskDB/sym2014.08.23
In other words, y is a pair where the last element is the TP logfile and the first element is the number of messages written to this logfile so far.
This is the number of messages which the RDB will replay. Given the single-threaded nature of this process, the RDB will neither miss nor duplicate any of these messages.
万一 RDB 在接近一天结束时关闭并且我们重新启动它,RDB 使用 .u.rep 订阅 TP 并获取 TP 日志文件中的消息数和日志文件的位置作为
q) y
10000000 /- 10 million
`:/location
比如说,RDB 花了 5 分钟从日志文件重播 1000 万条消息,但在这 5 分钟内,TP 从 FeedHandler 收到了 1000 条消息。
那1000条消息会发生什么,这1000条消息同时存在于什么地方,RDB在1000万条消息后如何接收消息?
当 RDB 重播时,1000 条消息存储在 tickerplant 进程的输出队列中。您可以使用 .z.W
查看输出队列。
一旦 RDB 完成重放 1000 万条消息,它将最终开始从 TP 输出队列接收记录,直到完全耗尽,此时 RDB 已完全赶上并与 tickerplant 同步
参考 - https://code.kx.com/q/wp/rt-tick/#tickerplant-log-replay
The second argument to .u.rep is simpler and would look like:
q)y
11995
`:C:/OnDiskDB/sym2014.08.23
In other words, y is a pair where the last element is the TP logfile and the first element is the number of messages written to this logfile so far.
This is the number of messages which the RDB will replay. Given the single-threaded nature of this process, the RDB will neither miss nor duplicate any of these messages.
万一 RDB 在接近一天结束时关闭并且我们重新启动它,RDB 使用 .u.rep 订阅 TP 并获取 TP 日志文件中的消息数和日志文件的位置作为
q) y
10000000 /- 10 million
`:/location
比如说,RDB 花了 5 分钟从日志文件重播 1000 万条消息,但在这 5 分钟内,TP 从 FeedHandler 收到了 1000 条消息。
那1000条消息会发生什么,这1000条消息同时存在于什么地方,RDB在1000万条消息后如何接收消息?
当 RDB 重播时,1000 条消息存储在 tickerplant 进程的输出队列中。您可以使用 .z.W
查看输出队列。
一旦 RDB 完成重放 1000 万条消息,它将最终开始从 TP 输出队列接收记录,直到完全耗尽,此时 RDB 已完全赶上并与 tickerplant 同步