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

Exception when calling get_data_dirs in start_varlogsn.py #88

Closed
ijsong opened this issue Aug 29, 2022 · 1 comment · Fixed by #90, #87, #94 or #95
Closed

Exception when calling get_data_dirs in start_varlogsn.py #88

ijsong opened this issue Aug 29, 2022 · 1 comment · Fixed by #90, #87, #94 or #95
Labels
bug Something isn't working

Comments

@ijsong
Copy link
Member

ijsong commented Aug 29, 2022

Current Behavior

When the storage node has no log stream replica, the field logStreams of GetStorageNode RPC reply is null rather than an empty array. The start_varlogsn.py script raises an exception when decoding that.

Expected Behavior

We expect that decoding works well and the logStreams is an empty array.

Steps To Reproduce

  1. Start varlog cluster.
  2. Add a storage node.
  3. Fetch storage node metadata from admin by using GetStorageNode. Use varlogctl.
  4. We can see that field logStreams is null.
  5. Moreover, if we restart the storage node, it cannot restart because start_varlogsn.py script raises the exception above.

Environment

  • Varlog version: v0.2.0
  • OS:
  • Architecture:

Anything else

@ijsong ijsong added the bug Something isn't working label Aug 29, 2022
@ijsong ijsong changed the title JSON Decoding exception when calling get_data_dirs in start_varlogsn.py Exception when calling get_data_dirs in start_varlogsn.py Aug 29, 2022
ijsong added a commit that referenced this issue Aug 29, 2022
…e rather than null when no log stream replicas

When there was no log stream replica in a storage node, the JSON field `logStreams` in the
GetStrorageNode response was null. It can cause an exception while accessing the field after
decoding the response, for example `TypeError: 'NoneType' object is not iterable`.

This patch fixed the above case by setting empty slice to the
`proto/snpb.(StorageNodeMetadataDescriptor).LogStreamReplicas`.

Resolves #88
@ijsong
Copy link
Member Author

ijsong commented Aug 29, 2022

GetStorageNode RPC still returns null of logStreams in its response despite of #90. We need to fix start_varlogsn.py to handle this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant