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

[AV-87721] GSI release documentation for Terraform V1.4.0 #244

Open
wants to merge 74 commits into
base: AV-87721_release_documentation_for_V1.4.0
Choose a base branch
from

Conversation

a-atri
Copy link
Collaborator

@a-atri a-atri commented Nov 21, 2024

Jira

  • AV-87721

Description

Release documentation of GSI for terraform version V1.4.0

Type of Change

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Manual Testing Approach

How was this change tested and do you have evidence? (REQUIRED: Select at least 1)

  • Manually tested
  • Unit tested
  • Acceptance tested
  • Unable to test / will not test (Please provide comments in section below)

Testing

Testing

Required Checklist:

  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if required)
  • I have run make fmt and formatted my code
  • I have made sure that no schema field is marked with both requiresReplace and computed

Further comments

@a-atri a-atri requested review from a team as code owners November 21, 2024 09:49
@a-atri a-atri requested review from rajagp and simon-dew November 21, 2024 14:07
Copy link
Contributor

@simon-dew simon-dew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

docs/guides/1.4.0-upgrade-guide.md Outdated Show resolved Hide resolved
docs/guides/1.4.0-upgrade-guide.md Outdated Show resolved Hide resolved
docs/guides/1.4.0-upgrade-guide.md Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved

This example shows how to create secondary indexes on a Capella cluster.

This creates 5 deferred indexes in test.test.test. Deferred indexes are best suited for large indexes, or when creating many indexes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe spell it out?

Suggested change
This creates 5 deferred indexes in test.test.test. Deferred indexes are best suited for large indexes, or when creating many indexes.
This creates 5 deferred indexes in a collection called `test`, which is located in a scope called `test` within a bucket also called `test`. Deferred indexes are best suited for large indexes, or when creating many indexes.

Copy link
Contributor

@rajagp rajagp Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to what Simon indicated - which is providing the clarify - I though we had discussed this previously and we we were going to use more meaningful names and not just test, test, test - at very laest "mybucket", "myscope" and "mycollection"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also many indexes to multiple indexes. (Essentially, since we can't give a number, we can leave it as plural)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the examples yesterday so this is outdated. Please see:
https://github.com/couchbasecloud/terraform-provider-couchbase-capella/blob/7147d366f6fffee59b4772e16bf910e33dc9e680/examples/gsi/deferred/README.md

The intro now says:

This example shows how to create secondary indexes on a Capella cluster.

This creates 5 deferred indexes in api.metrics.memory

Deferred indexes are best suited for large indexes (like partitioned indexes), or when creating many indexes. When in doubt, use deferred indexes :)

If creating indexes in bulk, it is strongly recommended to build indexes in batches of 100 or less.

To run configure your Couchbase Capella provider as described in README in the root of this project.

examples/gsi/deferred/README.md Outdated Show resolved Hide resolved

This example shows how to create secondary indexes on a Capella cluster.

This creates 5 non-deferred indexes in test.test.test. Non-deferred indexes are best suited when creating small indexes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, maybe spell it out?

Suggested change
This creates 5 non-deferred indexes in test.test.test. Non-deferred indexes are best suited when creating small indexes.
This creates 5 non-deferred indexes in a collection called `test`, which is located in a scope called `test` within a bucket also called `test`. Non-deferred indexes are best suited when creating small indexes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outdated. Please see:
https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/7147d366f6fffee59b4772e16bf910e33dc9e680/examples/gsi/non_deferred

The intro now says:

This example shows how to create secondary indexes on a Capella cluster.

This creates 1 non-deferred indexes in api.metrics.memory. Non-deferred indexes are best suited when creating 1 small index.

To run configure your Couchbase Capella provider as described in README in the root of this project.

examples/gsi/non_deferred/README.md Outdated Show resolved Hide resolved
examples/gsi/non_deferred/README.md Outdated Show resolved Hide resolved
Comment on lines 21 to 22
### Ensure you create indexes.json which is a file with indexes
### Place this file in the same directory as the terraform script.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As before, I don't like misusing the heading semantics just for emphasis.

Suggested change
### Ensure you create indexes.json which is a file with indexes
### Place this file in the same directory as the terraform script.
**Ensure you create `indexes.json`, which is a file with indexes.**
**Place this file in the same directory as the terraform script.**

docs/index.md Outdated
@@ -306,3 +306,7 @@ To get started, see the [Provider Example Configs](https://github.com/couchbasec

Manage Flush Bucket

* [Manage GSI](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/gsi)

Manage GSI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l0n3star Tagging in reference to discussion on slack thread. Tagging here so we don't miss

Copy link
Contributor

@l0n3star l0n3star Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-atri @simon-dew

please note I made significant updates (yesterday) to the non-deferred and deferred examples for several reasons. first, had to include output showing index status. this is priority for priya and request came in 2 days ago. second, updated the examples to give better guidance to users. in particular, we should encourages users to create 1 non-deferred index. third, priya wanted to use different bucket/scope/collection names to make it more user friendly.

please reference updated examples below:
https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/7147d366f6fffee59b4772e16bf910e33dc9e680/examples/gsi

@@ -19,6 +19,7 @@ In this demo, we will perform the following operations:
15. Create a new audit log settings.
16. Enable private endpoint service on the cluster.
17. Create a new network peer.
18. Create an index.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of index? GSI and deferred or non-deferred?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's partitioned index (non-deferred).

Co-authored-by: Simon Dew <39966290+simon-dew@users.noreply.github.com>
Comment on lines +181 to +201
locals {
index_template = templatefile("${path.module}/indexes.json", {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
})
}
```
```
resource "couchbase-capella_query_indexes" "new_indexes" {
for_each = jsondecode(local.index_template).resource["couchbase-capella_indexes"]
organization_id = each.value.organization_id
project_id = each.value.project_id
cluster_id = each.value.cluster_id
bucket_name = each.value.bucket_name
scope_name = each.value.scope_name
collection_name = each.value.collection_name
index_name = each.value.index_name
index_keys = each.value.index_keys
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should encourage customers to only create 1 non-deferred index. Testing shows creating multiple non-deferred indexes is problematic. So please change to :

resource "couchbase-capella_query_indexes" "idx" {
  organization_id = var.organization_id
  project_id      = var.project_id
  cluster_id      = var.cluster_id

  bucket_name     = var.bucket_name
  scope_name      = var.scope_name
  collection_name = var.collection_name

  index_name = var.index_name
  index_keys = var.index_keys
}

output "idx" {
  value = couchbase-capella_query_indexes.idx
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@l0n3star l0n3star Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file no longer needed for non-deferred example.

@a-atri a-atri dismissed simon-dew’s stale review December 5, 2024 08:49

We have updated this description

Copy link
Contributor

@nishant-tripathy nishant-tripathy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

6 participants