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

viewbuildstatus nodetool command throws an exception during materialized view building in progress #289

Open
rayakurl opened this issue Feb 10, 2022 · 1 comment
Assignees
Labels
bug Something isn't working right

Comments

@rayakurl
Copy link

rayakurl commented Feb 10, 2022

There are 2 problems with the same root cause:

  1. There is an exception presented to the user before the correct message regarding the materialized view building progress:
    Example:
(venv_dtest_3.8.6) raya@raya-Latitude-5421:~/scylla_repo/scylla-ccm(next)$ ccm node1 nodetool viewbuildstatus keyspace1 m_view
Traceback (most recent call last):

  File "/home/raya/scylla_repo/scylla-ccm/ccm", line 75, in <module>

    cmd.run()

  File "/home/raya/scylla_repo/scylla-ccm/ccmlib/cmds/node_cmds.py", line 262, in run

    stdout, stderr = self.node.nodetool(" ".join(self.args[1:]))

  File "/home/raya/scylla_repo/scylla-ccm/ccmlib/scylla_node.py", line 662, in nodetool

    return super().nodetool(*args, **kwargs)

  File "/home/raya/scylla_repo/scylla-ccm/ccmlib/node.py", line 794, in nodetool

    raise NodetoolError(" ".join(nodetool), exit_status, stdout, stderr)

ccmlib.node.NodetoolError: Nodetool command '/home/raya/.ccm/scylla-repository/unstable/master/latest/scylla-tools-java/bin/nodetool -h 127.0.0.1 -p 7100 viewbuildstatus keyspace1 m_view' failed; exit status: 1; stdout: keyspace1.m_view has not finished building; node status is below.



Host      Info   

127.0.0.2 STARTED

127.0.0.3 STARTED

127.0.0.1 STARTED
  1. Since the table of "Host" and "info" columns is presented in the exception stdout, the SUCCESS status is never presented.
    When the materialized view fully built , only the following string is presented to the user:
    " view has finished building"

According to official viewbuildstatus documentation:

viewbuildstatus - Shows the progress of a materialized view build.

For example:

nodetool viewbuildstatus my_keyspace my_view

my_view has not finished building; node status is below.

Host Info

55.40.72.17 STARTED
Output options:

UNKNOWN - The host doesn’t know about that view.

STARTED - The host is building the view.

SUCCESS - The host has finished building the view.

Seems like the System.exit(1) code origin is from Cassandra. So we need to either remove the exception or to update the viewbuildstatus documentation page with this behavior.

        System.out.println(String.format("%s.%s has not finished building; node status is below.", keyspace, view));
        System.out.println();
        builder.printTo(System.out);
        System.exit(1);
    } else {
        System.out.println(String.format("%s.%s has finished building", keyspace, view));
        System.exit(0);
@rayakurl rayakurl changed the title viewnodebuildstatus nodetool command throws an exception during materialized view building in progress viewbuildstatus nodetool command throws an exception during materialized view building in progress Feb 10, 2022
@nyh
Copy link
Contributor

nyh commented Jul 11, 2023

@rayakurl it seems you added (in dtest commit 8fac9535b) dtests for nodetool viewbuildstatus (in materialized_views_test.py), and discovered this bug, but left it out of the test. As far as I can tell, the dtests we have focus on checking the individual host status before view building completes, and only check the first line when it becomes the success (after view building completes), so it misses this bug. I guess intentionally? (to have only passing tests)

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

No branches or pull requests

3 participants