Skip to content

[WIP] Cosmos databases & collections#3232

Closed
katbyte wants to merge 25 commits into
masterfrom
cosmos/db-collections
Closed

[WIP] Cosmos databases & collections#3232
katbyte wants to merge 25 commits into
masterfrom
cosmos/db-collections

Conversation

@katbyte

@katbyte katbyte commented Apr 11, 2019

Copy link
Copy Markdown
Collaborator

cosmos:
top level (moved to separate pr #3442)

  • mongo databases
  • sql databases
  • cassandra keyspaces
  • tables

top level

  • mongo collection
  • sql container
  • cassandra table

container/collections:

  • [-] mongo collections (index reads are empty, shardKey and index TTL broken)
  • [-] sql containers (all reads fail with an unmarshall error, no properties added yet)
  • [-] cassandra tables

fixes #1671
fixes #548

@katbyte

katbyte commented Apr 11, 2019

Copy link
Copy Markdown
Collaborator Author

depends on Azure/azure-sdk-for-go#4453 to be merged and released

@katbyte katbyte added this to the Blocked milestone Apr 11, 2019
@katbyte katbyte added the upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR label Apr 11, 2019
@katbyte

katbyte commented Apr 12, 2019

Copy link
Copy Markdown
Collaborator Author

SDK issues for mongo:

  • the SDK doesn't correctly populate Indexes on a read, despite seeing the data go across the wire it's always empty. Create/Update is indexes.key.keys and get returns indexes.key.key.
  • The SDK/API treat indexes.key.keys as a list when the API only accepts a single value?
  • if ExpireAfterSeconds is set on anything other then a _ts index the API 404s
  • ShardKey doesn't work, when supplied the exact values returned by the API for an existing collection the error The partition key component definition path ''$v'\\\\/akey\\\\/'$v'' could not be accepted, failed near position '0'. is received.
    get data:
		"shardKey": {
			"akey": "Hash"
		},

put data:

			"shardKey": {
				"akey": "Hash"
			}

@katbyte

katbyte commented Apr 12, 2019

Copy link
Copy Markdown
Collaborator Author

SDK Issues for SQL:
DB creates but theres a unmarshal error on gets:

* azurerm_cosmos_sql_container.test: Error making get request for Cosmos SQL Container seven-day-container (Account kt-cosmos-sql, Database seven-day-db): documentdb.DatabaseAccountsClient#GetSQLContainer: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal object into Go struct field IndexingPolicy.excludedPaths of type string' JSON = '{"properties":{"id":"seven-day-container","indexingPolicy":{"indexingMode":"consistent","automatic":true,"includedPaths":[{"path":"/*","indexes":[{"kind":"Range","dataType":"Number","precision":-1},{"kind":"Range","dataType":"String","precision":-1}]}],"excludedPaths":[{"path":"/\"_etag\"/?"}]},"conflictResolutionPolicy":{"mode":"LastWriterWins","conflictResolutionPath":"/_ts","conflictResolutionProcedure":""},"_rid":"639ZAJUnyLc=","_ts":1555048744,"_self":"dbs/639ZAA==/colls/639ZAJUnyLc=/","_etag":"\"0000ec30-0000-0a00-0000-5cb029280000\"","_docs":"docs/","_sprocs":"sprocs/","_triggers":"triggers/","_udfs":"udfs/","_conflicts":"conflicts/"}}'

@katbyte

katbyte commented Apr 12, 2019

Copy link
Copy Markdown
Collaborator Author

cassandra:

all gets fail with:

--- FAIL: TestAccAzureRMCosmosCassandraTable_debug (6.41s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
        	* azurerm_cosmos_cassandra_table.test: 1 error occurred:
        	* azurerm_cosmos_cassandra_table.test: Error checking for presence of creating Cosmos Cassandra Table littbobbytables (Account kt-cosmos-cassandra, Keyspace sevendaykeyspace): documentdb.DatabaseAccountsClient#GetCassandraTable: Failure responding to request: StatusCode=401 -- Original Error: autorest/azure: Service returned an error. Status=401 Code="Unauthorized" Message="Required Header authorization is missing. Ensure a valid Authorization token is passed.\r\nActivityId: cb279bd7-11e5-4bc1-8f33-1baacbd50784, Microsoft.Azure.Documents.Common/2.2.0.0"

@katbyte katbyte force-pushed the cosmos/db-collections branch from d6388f3 to f515450 Compare April 18, 2019 22:30
@katbyte

katbyte commented May 1, 2019

Copy link
Copy Markdown
Collaborator Author

blocked on #3335

@katbyte

katbyte commented May 16, 2019

Copy link
Copy Markdown
Collaborator Author

Going to close this as the rest will be opened as separate PRs

@katbyte katbyte closed this May 16, 2019
@tombuildsstuff tombuildsstuff deleted the cosmos/db-collections branch May 23, 2019 07:31
@github-actions

Copy link
Copy Markdown
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies hashibot/ignore service/cosmosdb size/XXL upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: CosmosDB Database Feature Request: CosmosDB Collections

2 participants