Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add table functions mo_configurations #11792

Merged
merged 32 commits into from
Sep 20, 2023
Merged

Conversation

daviszhen
Copy link
Contributor

@daviszhen daviszhen commented Sep 15, 2023

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #11499
issue #11711

What this PR does / why we need it:

讨论:https://github.com/matrixorigin/docs/blob/main/design/system_view.md#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E9%80%89%E9%A1%B9

修改的内容
1, cn,tn,log 增加了dump配置项的步骤。将config 转成一组 key-value构造成配置信息ConfigData.
2,Process增加hakeeper接口。Hakeeper logservice.CNHAKeeperClient
3,与hakeeper的心跳增加发送ConfigData

未完成的部分:
1,proxy的配置项

实现思路:

  1. 通过hakeeper的心跳(cn,tn,log),将配置信息传给hakeeper。

    目前设置了cn,tn,log的前50个心跳包中会带上配置信息。之后就不会再发送了。

    • SendCNHeartbeat
    • SendTNHeartbeat
    • SendLogHeartbeat
  2. 需要配置信息时,通过GetClusterDetails 取集群信息。

    在集群信息中,存储各个节点的配置信息。

  3. 配置信息的准备。

    • 在节点启动后,配置文件的内容(Content)就能拿到。
      此时通过Content反序列化成配置对象(Config)。

    • 对Config进行展开。flatten成一组key-value。并保存。

    • hakeeper发送心跳时,会将key-value给hakeeper。(避免重复发送)

    • hakeeper会存储这些心跳。

    另一种方案。

    • 将配置文件内容发送给hakeeper。

    • mo_configurations查询时,拿到配置文件内容。再反序列化成Config。

      但是发现有循环依赖的问题。

  4. mo_configurations查询时,GetClusterDetails取数据。

    会将配置信息填到结果中。

@mergify mergify bot added the kind/feature label Sep 15, 2023
@mergify mergify bot merged commit 3ac504c into matrixorigin:main Sep 20, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature size/XL Denotes a PR that changes [1000, 1999] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.