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

replication controls inheritance note incorrect #18816

Open
annrpom opened this issue Aug 13, 2024 · 1 comment
Open

replication controls inheritance note incorrect #18816

annrpom opened this issue Aug 13, 2024 · 1 comment

Comments

@annrpom
Copy link
Contributor

annrpom commented Aug 13, 2024

We have this little note at the bottom of the replication zone variables subtitle here that states:

image

A partition will inherit from its parent index

Jira issue: DOC-10922

@annrpom
Copy link
Contributor Author

annrpom commented Aug 13, 2024

Here is an example of the inheritance (on a 9 node cluster):

[email protected]:26257/movr> CREATE TABLE test(i INT PRIMARY KEY, j INT) PARTITION BY LIST (i) (                                                  
                        ->   PARTITION one_and_five    VALUES IN (1, 5)                                                                         
                        -> );                                                                                                                   
CREATE TABLE

[email protected]:26257/movr> ALTER PARTITION one_and_five OF TABLE test CONFIGURE ZONE USING gc.ttlseconds = 10;                                  
CONFIGURE ZONE 1

Time: 73ms total (execution 73ms / network 0ms)

[email protected]:26257/movr> ALTER INDEX test@test_pkey CONFIGURE ZONE USING num_replicas = 4;                                                    
CONFIGURE ZONE 1

Time: 204ms total (execution 204ms / network 0ms)

-- Looking at the partition, at /Table/112/1/1, we see that the amount of replicas it has is what we set for its parent index:
[email protected]:26257/movr> select replicas from crdb_internal.ranges where start_pretty = '/Table/112/1/1';                                     
  replicas
-------------
  {1,2,4,7}
(1 row)

Time: 149ms total (execution 148ms / network 0ms)

-- To emphasize this, let's set the amount of replicas on the table to be a different number:
[email protected]:26257/movr> alter table test configure zone using num_replicas = 7;                                                              
CONFIGURE ZONE 1

-- And we see that the amount of replicas on the table is:
[email protected]:26257/movr> select replicas from crdb_internal.ranges where start_pretty = '/Table/112';                                         
     replicas
-------------------
  {1,3,4,5,6,7,9}
(1 row)

Time: 156ms total (execution 156ms / network 0ms)

-- But the one for our partition has stayed the same:
[email protected]:26257/movr> select replicas from crdb_internal.ranges where start_pretty = '/Table/112/1/1';                                     
  replicas
-------------
  {1,2,4,7}
(1 row)

Time: 153ms total (execution 153ms / network 0ms)

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

No branches or pull requests

1 participant