Skip to content

Commit cbf3384

Browse files
Onprem 2.0 mongodb index notice (#994)
1 parent 7c61035 commit cbf3384

File tree

2 files changed

+104
-2
lines changed

2 files changed

+104
-2
lines changed

codefresh/README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,58 @@ This major chart version change (v1.4.X -> v2.0.0) contains some **incompatible
684684

685685
**Before applying the upgrade, read through this section!**
686686

687-
#### ⚠️ [Kcfi](https://github.com/codefresh-io/kcfi) Deprecation
687+
#### ⚠️ New MongoDB Indexes
688+
689+
Starting from version 2.0.0, two new MongoDB indexes have been adedd that are vital for optimizing database queries and enhancing overall system performance. It is crucial to create these indexes before performing the upgrade to avoid any potential performance degradation.
690+
691+
- `account_1_annotations.key_1_annotations.value_1` (db: `codefresh`; collection: `annotations`)
692+
```json
693+
{
694+
"account" : 1,
695+
"annotations.key" : 1,
696+
"annotations.value" : 1
697+
}
698+
```
699+
700+
- `accountId_1_entityType_1_entityId_1` (db: `codefresh`; collection: `workflowprocesses`)
701+
702+
```json
703+
{
704+
"accountId" : 1,
705+
"entityType" : 1,
706+
"entityId" : 1
707+
}
708+
```
709+
710+
To prevent potential performance degradation during the upgrade, it is important to schedule a maintenance window during a period of low activity or minimal user impact and create the indexes mentioned above before initiating the upgrade process. By proactively creating these indexes, you can avoid the application automatically creating them during the upgrade and ensure a smooth transition with optimized performance.
711+
712+
##### Index Creation
713+
714+
If you're hosting MongoDB on [Atlas](https://www.mongodb.com/atlas/database), use the following [Create, View, Drop, and Hide Indexes](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/) guide to create indexes mentioned above. It's important to create them in a rolling fashion (i.e. **Build index via rolling process** checkbox enabled) in produciton environment.
715+
716+
For self-hosted MongoDB, see the following instruction:
717+
718+
- Connect to the MongoDB server using the [mongosh](https://www.mongodb.com/docs/mongodb-shell/install/) shell. Open your terminal or command prompt and run the following command, replacing <connection_string> with the appropriate MongoDB connection string for your server:
719+
```console
720+
mongosh "<connection_string>"
721+
```
722+
723+
- Once connected, switch to the `codefresh` database where the index will be located using the `use` command.
724+
```console
725+
use codefresh
726+
```
727+
728+
- To create the indexes, use the createIndex() method. The createIndex() method should be executed on the db object.
729+
```console
730+
db.workflowprocesses.createIndex({ account: 1, 'annotations.key': 1, 'annotations.value': 1 }, { name: 'account_1_annotations.key_1_annotations.value_1', sparse: true, background: true })
731+
```
732+
733+
```console
734+
db.annotations.createIndex({ accountId: 1, entityType: 1, entityId: 1 }, { name: 'accountId_1_entityType_1_entityId_1', background: true })
735+
```
736+
After executing the createIndex() command, you should see a result indicating the successful creation of the index.
737+
738+
- #### ⚠️ [Kcfi](https://github.com/codefresh-io/kcfi) Deprecation
688739

689740
This major release deprecates [kcfi](https://github.com/codefresh-io/kcfi) installer. The recommended way to install Codefresh On-Prem is **Helm**.
690741
Due to that, Kcfi `config.yaml` will not be compatible for Helm-based installation.

codefresh/README.md.gotmpl

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,58 @@ This major chart version change (v1.4.X -> v2.0.0) contains some **incompatible
685685

686686
**Before applying the upgrade, read through this section!**
687687

688-
#### ⚠️ [Kcfi](https://github.com/codefresh-io/kcfi) Deprecation
688+
#### ⚠️ New MongoDB Indexes
689+
690+
Starting from version 2.0.0, two new MongoDB indexes have been adedd that are vital for optimizing database queries and enhancing overall system performance. It is crucial to create these indexes before performing the upgrade to avoid any potential performance degradation.
691+
692+
- `account_1_annotations.key_1_annotations.value_1` (db: `codefresh`; collection: `annotations`)
693+
```json
694+
{
695+
"account" : 1,
696+
"annotations.key" : 1,
697+
"annotations.value" : 1
698+
}
699+
```
700+
701+
- `accountId_1_entityType_1_entityId_1` (db: `codefresh`; collection: `workflowprocesses`)
702+
703+
```json
704+
{
705+
"accountId" : 1,
706+
"entityType" : 1,
707+
"entityId" : 1
708+
}
709+
```
710+
711+
To prevent potential performance degradation during the upgrade, it is important to schedule a maintenance window during a period of low activity or minimal user impact and create the indexes mentioned above before initiating the upgrade process. By proactively creating these indexes, you can avoid the application automatically creating them during the upgrade and ensure a smooth transition with optimized performance.
712+
713+
##### Index Creation
714+
715+
If you're hosting MongoDB on [Atlas](https://www.mongodb.com/atlas/database), use the following [Create, View, Drop, and Hide Indexes](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/) guide to create indexes mentioned above. It's important to create them in a rolling fashion (i.e. **Build index via rolling process** checkbox enabled) in produciton environment.
716+
717+
For self-hosted MongoDB, see the following instruction:
718+
719+
- Connect to the MongoDB server using the [mongosh](https://www.mongodb.com/docs/mongodb-shell/install/) shell. Open your terminal or command prompt and run the following command, replacing <connection_string> with the appropriate MongoDB connection string for your server:
720+
```console
721+
mongosh "<connection_string>"
722+
```
723+
724+
- Once connected, switch to the `codefresh` database where the index will be located using the `use` command.
725+
```console
726+
use codefresh
727+
```
728+
729+
- To create the indexes, use the createIndex() method. The createIndex() method should be executed on the db object.
730+
```console
731+
db.workflowprocesses.createIndex({ account: 1, 'annotations.key': 1, 'annotations.value': 1 }, { name: 'account_1_annotations.key_1_annotations.value_1', sparse: true, background: true })
732+
```
733+
734+
```console
735+
db.annotations.createIndex({ accountId: 1, entityType: 1, entityId: 1 }, { name: 'accountId_1_entityType_1_entityId_1', background: true })
736+
```
737+
After executing the createIndex() command, you should see a result indicating the successful creation of the index.
738+
739+
- #### ⚠️ [Kcfi](https://github.com/codefresh-io/kcfi) Deprecation
689740

690741
This major release deprecates [kcfi](https://github.com/codefresh-io/kcfi) installer. The recommended way to install Codefresh On-Prem is **Helm**.
691742
Due to that, Kcfi `config.yaml` will not be compatible for Helm-based installation.

0 commit comments

Comments
 (0)