You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by GERey <gi...@git.apache.org> on 2015/02/24 21:58:45 UTC

[GitHub] incubator-usergrid pull request: Usergrid 409

GitHub user GERey opened a pull request:

    https://github.com/apache/incubator-usergrid/pull/164

    Usergrid 409

    Tested local deploy.
    Added support for cassandra keyspaces to be set in the tomcat properties file.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-usergrid USERGRID-409

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-usergrid/pull/164.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #164
    
----
commit f817f52437cfe3202db12c56b9f94b616ac8431c
Author: grey <gr...@apigee.com>
Date:   2015-02-23T20:02:26Z

    [USERGRID-409} Fixed all commit errors and merged the STATIC_APPLICATION_KEYSPACE and the SYSTEM_KEYSPACE into a single static ApplicationKeyspace. This allows us to separate a keyspace for each individual application on the system.

commit aac4a2fc946f957261e7c4cf46838abb4bca4148
Author: grey <gr...@apigee.com>
Date:   2015-02-23T20:05:56Z

    Fixed CoreSchemaManager

commit 08c1f1d08c7c6bb9ce3a4cf979e09fb0d733ef46
Author: grey <gr...@apigee.com>
Date:   2015-02-24T00:25:31Z

    Added fix for circular decencies and added support for multiple key spaces.

commit 07755c15c0d525f10328384aa9f9ffe0fb8393e7
Author: grey <gr...@apigee.com>
Date:   2015-02-24T02:32:43Z

    Merge branch 'USERGRID-273' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-409
    
    # By Dave Johnson (3) and Todd Nine (1)
    # Via Todd Nine
    * 'USERGRID-273' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
      Fixes problem with arquillian configuration and plugin scope
      Not needed in git.
      Don't run two schedulers.
      Move back to Guava 14.0.1 to enable JClouds to work properly, plus changes to Arquillian setup.

commit 53e73fbeffe8dbe956ed2500918abc6332ef0fbc
Author: grey <gr...@apigee.com>
Date:   2015-02-24T20:28:07Z

    Merge branch 'USERGRID-273' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-409
    
    # By Dave Johnson
    # Via Dave Johnson
    * 'USERGRID-273' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
      Effort to use arquillian-suite-extension
      Adding some JVM options to help with the OOM PermGen problems, and removing all tests from except for one (for now)
      changes to get REST tests working with Arquillian: - Add setenv.sh to set memory and debug options for Tomcat - Make Arqillian profile active by default - Add shutdown hook to stop job service when Usergrid is underplayed

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#issuecomment-75882748
  
    We need to do some acceptance testing on this to ensure all this change does is invalidate tokens.
    
    So we need to test the following.
    
    # Deploy our previous release to a cluster
    # Create an application.  Get our client_id and secret both org and app
    # Deploy a build from this branch
    # Ensure the client_id and secret for both org and app still work
    # Ensure that we can generate a new token.  Test signups etc and everything works as expected.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#discussion_r25294449
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java ---
    @@ -202,17 +201,17 @@ public void setupStaticKeyspace() throws Exception {
     
             if ( USE_VIRTUAL_KEYSPACES ) {
    --- End diff --
    
    This if isn't needed anymore, we don't always use virtual.  Every row key is app prefixed, and we put all systems into the same keyspace. Eventually, we'll move to an org->keyspace lookup system.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-usergrid/pull/164


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#discussion_r25294344
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java ---
    @@ -146,17 +145,17 @@ public void setupSystemKeyspace() throws Exception {
     
             migrate();
     
    -        cass.createColumnFamily( SYSTEM_KEYSPACE,
    -            createColumnFamilyDefinition( SYSTEM_KEYSPACE, APPLICATIONS_CF, ComparatorType.BYTESTYPE ) );
    +        cass.createColumnFamily( getApplicationKeyspace(),
    --- End diff --
    
    A lot of these CF's are necessary anymore.  Can you audit their usage and delete the ones that are no longer used?  IIRC the only ones we need to retain are the TOKENS_CF and the PRINCIPAL_TOKEN_CF for the inverse relationship


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by GERey <gi...@git.apache.org>.
Github user GERey commented on the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#issuecomment-76102107
  
    This change invalidates all previous tokens. 
    
    Tested the following: 
    Took previous release: Ran database/setup and superuser/setup  created a new user. Entered data into multiple collections. Saved the client_id and secret. Made sure I could get response from management/token using the client id and secret
    
    Deployed new release: Had to rerun database/setup in order to recreate the token database.Made sure I could access all data from the user and multiple collections. Made hits against management/token and also <orgname>/<appname> with the previous client id and secret ( but with a new token ) and verified they still worked. Also took the tomcat offline and added in the following line to the properties file. 
    
    cassandra.keyspace.application=test_keyspace
    
    I then reran the database/setup and superuser/setup endpoints and created a user with the exact same email as the previous user. Then created data in the "test_keyspace". The tomcat was taken offline and switched back to the default keyspace and I logged in using the same email and found the data that was created in the previous release. The client id and secret are different for the keyspaces and won't work across keyspaces. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#discussion_r25294645
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java ---
    @@ -230,7 +239,7 @@ public void setConsistencyLevelPolicy( ConsistencyLevelPolicy consistencyLevelPo
         /** @return keyspace for application UUID */
         public static String keyspaceForApplication( UUID applicationId ) {
             if ( USE_VIRTUAL_KEYSPACES ) {
    --- End diff --
    
    Just change this code, we always use virtual keyspaces, so the other scheme isn't valid any longer


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#discussion_r25294605
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java ---
    @@ -158,7 +164,7 @@ public void init() throws Exception {
             accessMap.put( "username", properties.getProperty( "cassandra.username" ) );
             accessMap.put( "password", properties.getProperty( "cassandra.password" ) );
             systemKeyspace =
    -                HFactory.createKeyspace( SYSTEM_KEYSPACE, cluster, consistencyLevelPolicy, ON_FAIL_TRY_ALL_AVAILABLE,
    +                HFactory.createKeyspace( getApplicationKeyspace() , cluster, consistencyLevelPolicy, ON_FAIL_TRY_ALL_AVAILABLE,
    --- End diff --
    
    Can we remove hector calls to create keyspace and our system functions?  The CP modules are more intelligent in their creation of the keyspaces.  If we can remove it here, lets do that.  Note that hector can still create CFs, but the RF settings on the keyspaces seem to not work well in practice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#discussion_r25294697
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java ---
    @@ -80,17 +79,17 @@ public void setupSystemKeyspace() throws Exception {
     
             logger.info( "Initialize system keyspace" );
     
    --- End diff --
    
    Same comment as before


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: Usergrid 409

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on the pull request:

    https://github.com/apache/incubator-usergrid/pull/164#issuecomment-76103439
  
    Looks good. Merging.  Just a note, after this is deployed, there's no migration.  Users will need to re-log in to regenerate their tokens.  UG will now operate out of a singular keyspace.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---