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

[Bifrost] restatectl logs generate-metadata command #2051

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Oct 10, 2024

Generates a JSON formatted log metadata for replicated-loglet.

Example Usage:

cargo run --bin restatectl -- logs generate-metadata -r 2 -n 2 -s N1:2 --nodeset N1,N2,N3 --pretty
{
  "version": 2,
  "logs": [
    [
      0,
      {
        "chain": [
          [
            1,
            {
              "kind": "replicated",
              "params": "{\"loglet_id\":1,\"sequencer\":\"N1:2\",\"replication\":{\"node\":2},\"nodeset\":[\"N1\",\"N2\",\"N3\"]}",
              "index": 0
            }
          ]
        ]
      }
    ],
    [
      1,
      {
        "chain": [
          [
            1,
            {
              "kind": "replicated",
              "params": "{\"loglet_id\":4294967297,\"sequencer\":\"N1:2\",\"replication\":{\"node\":2},\"nodeset\":[\"N3\",\"N1\",\"N2\"]}",
              "index": 0
            }
          ]
        ]
      }
    ]
  ]
}


Stack created with Sapling. Best reviewed with ReviewStack.

Generates a JSON formatted log metadata for replicated-loglet.


## Example Usage:
```console
cargo run --bin restatectl -- logs generate-metadata -r 2 -n 2 -s N1:2 --nodeset N1,N2,N3 --pretty
```

```
{
  "version": 2,
  "logs": [
    [
      0,
      {
        "chain": [
          [
            1,
            {
              "kind": "replicated",
              "params": "{\"loglet_id\":1,\"sequencer\":\"N1:2\",\"replication\":{\"node\":2},\"nodeset\":[\"N1\",\"N2\",\"N3\"]}",
              "index": 0
            }
          ]
        ]
      }
    ],
    [
      1,
      {
        "chain": [
          [
            1,
            {
              "kind": "replicated",
              "params": "{\"loglet_id\":4294967297,\"sequencer\":\"N1:2\",\"replication\":{\"node\":2},\"nodeset\":[\"N3\",\"N1\",\"N2\"]}",
              "index": 0
            }
          ]
        ]
      }
    ]
  ]
}

```
Copy link
Contributor

@pcholakov pcholakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link

github-actions bot commented Oct 10, 2024

Test Results

  5 files  ±0    5 suites  ±0   3m 8s ⏱️ +22s
 46 tests +1   46 ✅ +1  0 💤 ±0  0 ❌ ±0 
117 runs  +3  117 ✅ +3  0 💤 ±0  0 ❌ ±0 

Results for commit ce92c82. ± Comparison against base commit a7debda.

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman merged commit ce92c82 into main Oct 10, 2024
16 of 17 checks passed
@AhmedSoliman AhmedSoliman deleted the pr2051 branch October 10, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants