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

[CDCSDK] yb-admin command list_change_data_streams is unable to filter out streams #10727

Closed
vaibhav-yb opened this issue Nov 30, 2021 · 1 comment
Labels

Comments

@vaibhav-yb
Copy link
Contributor

vaibhav-yb commented Nov 30, 2021

There is one yb-admin command to list all the DB stream IDs created. The syntax to use the command is as follows:

  • ./yb-admin list_change_data_streams

By default, the above command would fetch all the streams on the server. But there is an optional flag to specify which namespace (database) the command should return the stream ID of.

  • ./yb-admin list_change_data_streams [database_name]

Now even if I provide the optional database_name, the command still returns all the stream IDs available on the server.

Steps to reproduce:

  1. Assuming that the yugabyte database exists by default, create one more database i.e. CREATE DATABASE testdb;
  2. Connect to testdb --> \c testdb
  3. Create a table --> create table test (a int primary key, b text); -- this step might not be necessary
  4. Create stream IDs for databases
    $ ./yb-admin create_change_data_stream ysql.yugabyte
    CDC Stream ID: 7e90548121f84798902657ca5a5aa111  # This is the output
    
    $ ./yb-admin create_change_data_stream ysql.testdb
    CDC Stream ID: 5be8202a540a4c89ab464f7a10101c1f  # This is the output
  5. Now on executing ./yb-admin list_change_data_streams testdb
    Notice that I am getting both the stream IDs now i.e. not the ones specific to testdb
    CDC Streams:
    streams {
      stream_id: "5be8202a540a4c89ab464f7a10101c1f"
      table_id: "00004006000030008000000000000000"
      options {
        key: "id_type"
        value: "NAMESPACEID"
      }
      options {
        key: "checkpoint_type"
        value: "EXPLICIT"
      }
      options {
        key: "source_type"
        value: "CDCSDK"
      }
      options {
        key: "record_format"
        value: "PROTO"
      }
      options {
        key: "record_type"
        value: "CHANGE"
      }
      options {
        key: "state"
        value: "ACTIVE"
      }
    }
    streams {
      stream_id: "7e90548121f84798902657ca5a5aa111"
      table_id: "000033c0000030008000000000000000"
      options {
        key: "id_type"
        value: "NAMESPACEID"
      }
      options {
        key: "checkpoint_type"
        value: "EXPLICIT"
      }
      options {
        key: "source_type"
        value: "CDCSDK"
      }
      options {
        key: "record_format"
        value: "PROTO"
      }
      options {
        key: "record_type"
        value: "CHANGE"
      }
      options {
        key: "state"
        value: "ACTIVE"
      }
    }
@vaibhav-yb vaibhav-yb added the area/cdcsdk CDC SDK label Dec 21, 2021
@vaibhav-yb
Copy link
Contributor Author

Closing this as it has been fixed in a previous commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant