litmuschaos / litmus

Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
https://litmuschaos.io
Apache License 2.0
4.44k stars 697 forks source link

[Proposal] Support DocumentDB by replacing certain MongoDB operations #4812

Closed kwx4957 closed 6 days ago

kwx4957 commented 3 months ago

Proposed changes

the two operators $facet and $bucket are not supported by AWS. We are using the following features in graphQL and expect that modifying them with other features or code will make it easier to run LitmusChaos on AWS DocumentDB

Also $lookup does not supported multiple join

Related issue: #4459

Before

he following 2 unsupported operators were found:
  $facet | found 8 time(s)
  $bucket | found 1 time(s)

Unsupported operators by filename and line number:
  $facet | lines = found 8 time(s)
    ../../litmus/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go | lines = [664, 841]
    ../../litmus/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go | lines = [733, 955, 1131]
    ../../litmus/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/handler.go | lines = [531]
    ../../litmus/chaoscenter/graphql/server/pkg/environment/handler/handler.go | lines = [346]
    ../../litmus/chaoscenter/graphql/server/pkg/chaoshub/service.go | lines = [922]
  $bucket | lines = found 1 time(s)
    ../../litmus/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go | lines = [1106]
msg:"DB aggregate stage error: Aggregation stage not supported: '$lookup on multiple join conditions'"

After

Auth server

Processed 71 files, skipped 0 files
No unsupported operators found.
The following 24 supported operators were found:

Graphql server

Processed 149 files, skipped 0 files
No unsupported operators found.
The following 37 supported operators were found:

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Special notes for your reviewer:

AWS support api scanning

SarthakJain26 commented 2 months ago

@kwx4957 thanks for the PR, the changes looks good to me, but we also need some way to restrict usage of mongo operators that are not supported by DocumentDB. Adding a pre-commit check or PR check would help here.

namkyu1999 commented 2 months ago

+He will validate his PRs using Litmus-e2e tests.

kwx4957 commented 2 months ago

seperate proposal and feature