You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Peter Schuller (Created) (JIRA)" <ji...@apache.org> on 2012/02/12 01:34:59 UTC

[jira] [Created] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

improve TokenMetadata abstraction, naming - audit current uses
--------------------------------------------------------------

                 Key: CASSANDRA-3892
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Peter Schuller
            Assignee: Peter Schuller


CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.

I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-draft-v3.txt

v3 draft has a few minor typos/style fixes.

I'll try to come up with some better naming for the "real eligible" stuff.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206549#comment-13206549 ] 

Peter Schuller commented on CASSANDRA-3892:
-------------------------------------------

I'm going to file sub-tasks for things I realize as I look at the use-cases of TM so that review can be split between non-functional changes and functional changes (to a reasonable degree).

                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3892:
--------------------------------------

    Reviewer: thepaul
    
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt, CASSANDRA-3892-split-001-change-naming.txt, CASSANDRA-3892-split-002-make-moving-endpoints-a-map.txt, CASSANDRA-3892-split-003-remove-redundant-comment.txt, CASSANDRA-3892-split-004-add-assertion-when-declaring-leaving-endpoint.txt, CASSANDRA-3892-split-005-add-assertion-when-declaring-moving-endpoint.txt, CASSANDRA-3892-split-006-do-not-forget-nuking-in-moving-when-removing-endpoint.txt, CASSANDRA-3892-split-007-tokenmetadata-comments.txt, CASSANDRA-3892-split-008-make-firsttokenindex-private.txt, CASSANDRA-3892-split-009-storageservice-comments.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207341#comment-13207341 ] 

Jonathan Ellis commented on CASSANDRA-3892:
-------------------------------------------

is there any way to break this 97K patch up a bit for review?  Maybe one for IDE-driven renames, and one for manual edits?
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-draft-v2.txt

Attaching {{CASSANDRA-3892-draft-v2.txt}} with some more changes. I still consider it a draft because I have not yet done any testing, but it's more ripe for review now.

A few of the sub-tasks I created are IMO serious as well.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-split-009-storageservice-comments.txt
                CASSANDRA-3892-split-008-make-firsttokenindex-private.txt
                CASSANDRA-3892-split-007-tokenmetadata-comments.txt

Comments + making a method private now also attached.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt, CASSANDRA-3892-split-001-change-naming.txt, CASSANDRA-3892-split-002-make-moving-endpoints-a-map.txt, CASSANDRA-3892-split-003-remove-redundant-comment.txt, CASSANDRA-3892-split-004-add-assertion-when-declaring-leaving-endpoint.txt, CASSANDRA-3892-split-005-add-assertion-when-declaring-moving-endpoint.txt, CASSANDRA-3892-split-006-do-not-forget-nuking-in-moving-when-removing-endpoint.txt, CASSANDRA-3892-split-007-tokenmetadata-comments.txt, CASSANDRA-3892-split-008-make-firsttokenindex-private.txt, CASSANDRA-3892-split-009-storageservice-comments.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206596#comment-13206596 ] 

Peter Schuller edited comment on CASSANDRA-3892 at 2/13/12 1:00 AM:
--------------------------------------------------------------------

Attaching {{CASSANDRA\-3892\-draft\-v2.txt}} with some more changes. I still consider it a draft because I have not yet done any testing, but it's more ripe for review now.

A few of the sub-tasks I created are IMO serious as well.
                
      was (Author: scode):
    Attaching {{CASSANDRA-3892-draft-v2.txt}} with some more changes. I still consider it a draft because I have not yet done any testing, but it's more ripe for review now.

A few of the sub-tasks I created are IMO serious as well.
                  
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-draft.txt

Attaching {{CASSANDRA-3892-draft.txt}} which is a draft/work in progress. Mainly I'm asking for a "stop right there" if these types of changes seem like something that will never be accepted (they're semi-significant even though most of it constitute non-functional changes). I'm not asking nor suggesting for careful review, as it's better that I submit a more finished patch before that happens. Any requests for patch splitting strategies or overall "don't do this"/"don't do that" would be helpful though, if someone has them.

Other than what's there in the current version, I want to move pending range calculation into token meta data (it will need to be given a strategy), and things like {{StorageService.handleStateNormal()}} being responsible for keeping the internal state of tokenmetadata (removing from moving) up-to-date I want gone.

I've begun making naming and concepts a bit more consistent; the token meta data is now more consistently (but not fully yet) talking about endpoints as the main abstraction rather than mixing endpoints and tokens, and we have "joining endpoints" instead of "bootstrap tokens".

Moving endpoints is now also a map with O(<<n) access, and kept up to date in removeEndpoint() (may be other places that need fixing).

I adjusted comments for {{calculatePendingRanges}} to be clear:er; for example the old comments made it sound like we were sending writes to places for good measure because we're in "doubt", rather than because it is strictly necessary.

Unless I hear objections I'll likely continue this on Sunday and submit another patch.

                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206391#comment-13206391 ] 

Peter Schuller edited comment on CASSANDRA-3892 at 2/12/12 10:39 AM:
---------------------------------------------------------------------

Attaching {{CASSANDRA\-3892\-draft.txt}} which is a draft/work in progress. Mainly I'm asking for a "stop right there" if these types of changes seem like something that will never be accepted (they're semi-significant even though most of it constitute non-functional changes). I'm not asking nor suggesting for careful review, as it's better that I submit a more finished patch before that happens. Any requests for patch splitting strategies or overall "don't do this"/"don't do that" would be helpful though, if someone has them.

Other than what's there in the current version, I want to move pending range calculation into token meta data (it will need to be given a strategy), and things like {{StorageService.handleStateNormal()}} being responsible for keeping the internal state of tokenmetadata (removing from moving) up-to-date I want gone.

I've begun making naming and concepts a bit more consistent; the token meta data is now more consistently (but not fully yet) talking about endpoints as the main abstraction rather than mixing endpoints and tokens, and we have "joining endpoints" instead of "bootstrap tokens".

Moving endpoints is now also a map with O(<<n) access, and kept up to date in {{removeEndpoint()}} (may be other places that need fixing).

I adjusted comments for {{calculatePendingRanges}} to be clear:er; for example the old comments made it sound like we were sending writes to places for good measure because we're in "doubt", rather than because it is strictly necessary.

Unless I hear objections I'll likely continue this on Sunday and submit another patch.

                
      was (Author: scode):
    Attaching {{CASSANDRA-3892-draft.txt}} which is a draft/work in progress. Mainly I'm asking for a "stop right there" if these types of changes seem like something that will never be accepted (they're semi-significant even though most of it constitute non-functional changes). I'm not asking nor suggesting for careful review, as it's better that I submit a more finished patch before that happens. Any requests for patch splitting strategies or overall "don't do this"/"don't do that" would be helpful though, if someone has them.

Other than what's there in the current version, I want to move pending range calculation into token meta data (it will need to be given a strategy), and things like {{StorageService.handleStateNormal()}} being responsible for keeping the internal state of tokenmetadata (removing from moving) up-to-date I want gone.

I've begun making naming and concepts a bit more consistent; the token meta data is now more consistently (but not fully yet) talking about endpoints as the main abstraction rather than mixing endpoints and tokens, and we have "joining endpoints" instead of "bootstrap tokens".

Moving endpoints is now also a map with O(<<n) access, and kept up to date in removeEndpoint() (may be other places that need fixing).

I adjusted comments for {{calculatePendingRanges}} to be clear:er; for example the old comments made it sound like we were sending writes to places for good measure because we're in "doubt", rather than because it is strictly necessary.

Unless I hear objections I'll likely continue this on Sunday and submit another patch.

                  
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207351#comment-13207351 ] 

Peter Schuller commented on CASSANDRA-3892:
-------------------------------------------

Sure. Are you okay with one patch with all renames (IDE and human, but strictly renames *only*), a third small patch for minor functional changes (e.g, maintaining movingtokens when delcareNormalToken() is called), and a third patch adjusting some comments/discussion?


                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206391#comment-13206391 ] 

Peter Schuller edited comment on CASSANDRA-3892 at 2/12/12 10:39 AM:
---------------------------------------------------------------------

Attaching {{CASSANDRA\-3892\-draft.txt}} which is a draft/work in progress. Mainly I'm asking for a "stop right there" if these types of changes seem like something that will never be accepted (they're semi-significant even though most of it constitute non-functional changes). I'm not asking nor suggesting for careful review, as it's better that I submit a more finished patch before that happens. Any requests for patch splitting strategies or overall "don't do this"/"don't do that" would be helpful though, if someone has them.

Other than what's there in the current version, I want to move pending range calculation into token meta data (it will need to be given a strategy), and things like {{StorageService.handleStateNormal()}} being responsible for keeping the internal state of tokenmetadata (removing from moving) up-to-date I want gone.

I've begun making naming and concepts a bit more consistent; the token meta data is now more consistently (but not fully yet) talking about endpoints as the main abstraction rather than mixing endpoints and tokens, and we have "joining endpoints" instead of "bootstrap tokens".

Moving endpoints is now also a map with O(<<n) access, and kept up to date in {{removeEndpoint()}} (may be other places that need fixing).

I adjusted comments for {{calculatePendingRanges}} to be clearer; for example the old comments made it sound like we were sending writes to places for good measure because we're in "doubt", rather than because it is strictly necessary.

Unless I hear objections I'll likely continue this on Sunday and submit another patch.

                
      was (Author: scode):
    Attaching {{CASSANDRA\-3892\-draft.txt}} which is a draft/work in progress. Mainly I'm asking for a "stop right there" if these types of changes seem like something that will never be accepted (they're semi-significant even though most of it constitute non-functional changes). I'm not asking nor suggesting for careful review, as it's better that I submit a more finished patch before that happens. Any requests for patch splitting strategies or overall "don't do this"/"don't do that" would be helpful though, if someone has them.

Other than what's there in the current version, I want to move pending range calculation into token meta data (it will need to be given a strategy), and things like {{StorageService.handleStateNormal()}} being responsible for keeping the internal state of tokenmetadata (removing from moving) up-to-date I want gone.

I've begun making naming and concepts a bit more consistent; the token meta data is now more consistently (but not fully yet) talking about endpoints as the main abstraction rather than mixing endpoints and tokens, and we have "joining endpoints" instead of "bootstrap tokens".

Moving endpoints is now also a map with O(<<n) access, and kept up to date in {{removeEndpoint()}} (may be other places that need fixing).

I adjusted comments for {{calculatePendingRanges}} to be clear:er; for example the old comments made it sound like we were sending writes to places for good measure because we're in "doubt", rather than because it is strictly necessary.

Unless I hear objections I'll likely continue this on Sunday and submit another patch.

                  
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-split-006-do-not-forget-nuking-in-moving-when-removing-endpoint.txt
                CASSANDRA-3892-split-005-add-assertion-when-declaring-moving-endpoint.txt
                CASSANDRA-3892-split-004-add-assertion-when-declaring-leaving-endpoint.txt
                CASSANDRA-3892-split-003-remove-redundant-comment.txt
                CASSANDRA-3892-split-002-make-moving-endpoints-a-map.txt
                CASSANDRA-3892-split-001-change-naming.txt

Attaching 6 incremental patches. They must be applied/considered in order, as they won't apply out of order.

There is a seventh patch coming containing the various changes and additions of comments/documentation.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt, CASSANDRA-3892-split-001-change-naming.txt, CASSANDRA-3892-split-002-make-moving-endpoints-a-map.txt, CASSANDRA-3892-split-003-remove-redundant-comment.txt, CASSANDRA-3892-split-004-add-assertion-when-declaring-leaving-endpoint.txt, CASSANDRA-3892-split-005-add-assertion-when-declaring-moving-endpoint.txt, CASSANDRA-3892-split-006-do-not-forget-nuking-in-moving-when-removing-endpoint.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207357#comment-13207357 ] 

Jonathan Ellis commented on CASSANDRA-3892:
-------------------------------------------

Sounds good.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3892:
--------------------------------------

    Attachment: CASSANDRA-3892-draft-v4.txt

{{v4}} uses the terminology "joined endpoints" for what was previously the un-named things in the tokenToEndpointMap (they did not quite correspond to "normal", because a node could simultaneously be moving and be in the tokenToEndpointMap - same for leaving).

We now have:

* Joined endpoints - fully joined, taking reads (previously unnamed, was in tokenToEndpointMap)
* Moving endpoints - joined endpoints that are also currently moving.
* Joining endpoints - not yet joined, in the process of joining (previously "bootstrap tokens").
* Leaving endpoints

Some of the methods have a bit less obnoxious names now than in {{v3}}.

                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206729#comment-13206729 ] 

Peter Schuller commented on CASSANDRA-3892:
-------------------------------------------

So for the record. Previous versions of the patch dabbled with terminology like "eligible for reads" when differentiating between them. However, I realized that it was conflating different issues and it felt cleaner to use some other term. "Joined" was the best I came up with; it's consistent with the other states we have, and it fits pretty well in the sense that it kind of does hit the nail on the head - the significance of a node in this state is that it is fully joined in the ring. It's not that it's "normal" for example, because of the fact that a moving endpoint is not normal. Nor is the primarily interesting property that it serves reads.

I feel fairly satisfied with this as a suggested initial step.

I'd like to start tackling the sub-tasks, but I will wait for some feedback on this first because I wouldn't want to do the others against a trunk without something like this first completed.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3892) improve TokenMetadata abstraction, naming - audit current uses

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207551#comment-13207551 ] 

Peter Schuller commented on CASSANDRA-3892:
-------------------------------------------

The first one is *only* renames. TokenMetadata.java is the only file containing manual changes; all other changes are purely IDE generated.
                
> improve TokenMetadata abstraction, naming - audit current uses
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-3892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>         Attachments: CASSANDRA-3892-draft-v2.txt, CASSANDRA-3892-draft-v3.txt, CASSANDRA-3892-draft-v4.txt, CASSANDRA-3892-draft.txt, CASSANDRA-3892-split-001-change-naming.txt, CASSANDRA-3892-split-002-make-moving-endpoints-a-map.txt, CASSANDRA-3892-split-003-remove-redundant-comment.txt, CASSANDRA-3892-split-004-add-assertion-when-declaring-leaving-endpoint.txt, CASSANDRA-3892-split-005-add-assertion-when-declaring-moving-endpoint.txt, CASSANDRA-3892-split-006-do-not-forget-nuking-in-moving-when-removing-endpoint.txt
>
>
> CASSANDRA-3417 has some background. I want to make the distinction more clear between looking at the ring from different perspectives (reads, writes, others) and adjust naming to be more clear on this. I also want to go through each use case and try to spot any subtle pre-existing bugs that I almost introduced in CASSANDRA-3417, had not Jonathan caught me.
> I will submit a patch soonish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira