-
Notifications
You must be signed in to change notification settings - Fork 27
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
PUT index requests with mappings objects always blindly excise #367
Comments
Thanks for the details! We have this task on our board to make the transformer load via ServiceLoader instead of indiscriminately running the same one (or shipping a catchall transformation) for every installation. In the meantime, removing the JsonTypeMappingTransformer() from this line entirely will suppress the changes that you’re noticing. The sooner that that goes out, the sooner we’ll start to find out what transformations we do need (other than host and auth transformations) and those findings would help us figure out how to manage transformations more intelligently. |
@sanathbhat, for your continued testing, I suggest removing the |
Issue confirmed on ES 7.10.2 to OS 2.7 migration. Replayer output:
|
mainline now has a flag for --transformer-config. By default now, when that flag is not set, no transformations will be performed. We're actively working on building out some sample transforms now. For more details on how to use them, including how to supply your own scripts using some scripting languages, please see the TrafficReplayer README. Since the root cause of this issue was that the replayer applied a transformation when there should have been none and that's now the default behavior, I'm marking this as fixed. Thanks for the feedback & let us know what else you find! |
What is the bug?
PUT index requests with a
mappings
object are always indiscriminately subject to excision of the top level object within themappings
object.How can one reproduce the bug?
With traffic capture and replayer modules running, make a put index request to source cluster via capture proxy server with the following sample body:
This would create the index on the source cluster as expected but the target cluster returns the following error:
On checking the logs, it can be seen that the target cluster received the request body shown in
Target request:
section below, instead of the original, where theproperties
object has been excised and its contents directly pushed into its parentmappings
. The likely cause of this can be traced to these lines of code: https://github.com/opensearch-project/opensearch-migrations/blob/main/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/JsonTypeMappingTransformer.java#L77-L87What is the expected behavior?
The above behavior was probably targeted at some open source version compatibility issue as a proof-of-concept solution but causes the replayer module to indiscriminately modify all put index request bodies making some of them erroneous and thereby failing to create indices on the target cluster. The expected behavior is that the index should be correctly created in both the source and target clusters wherein the replayer module carefully performs any request body transformations in an intelligent way only if required.
What is your host/environment?
Source/target cluster platforms: OCI
Source cluster version: OS 2.3
Target cluster version: OS 2.8
Oracle Linux host running capture proxy and replayer modules
Do you have any screenshots?
Decoded source/target request-response bodies from above screenshot:
Source request:
Source response:
Target request:
Target response:
Do you have any additional context?
N/A
The text was updated successfully, but these errors were encountered: