Skip to content

Strange behaviour with stored procedures in docker environment #1174

Closed
@jsbeanapps

Description

@jsbeanapps

Software versions
MySqlConnector version: 2.1.8
Server type: AWS Aurora MySql 5.7
.NET version: 6.0

Describe the bug
It's rather elusive and hard to replicate, but we have experienced it consistently for some time to give a description.

We have an application that runs in a dockerized environment with multiple frontend servers hosting. When we upgrade the application, we send a new docker container to AWS, and it loads up new instances of the application that runs side-by-side with the "old" version of the application for a couple of minutes to avoid downtime on the system.

In the application a number of stored procedures are automatically generated, and they're used to update columns in the database. When a new version of the software is uploaded, all stored procedures are regenerated and updated in the database.

Now, when some of the "old" versions of the application calls a stored procedure to update a table in the database data are written in the "wrong" columns. We don't see any exceptions in the system, so the update/create goes through. When we analyse the difference between the "old" and "new" version of the stored procedure, the only difference is the order in which the parameters of the procedure are listed in the "create" statement - the parameters are the same, just in a different order.

We have come up with a temporary fix where we sort the parameters by their name in the create statement, and then we don't experience the issue, but that seems a bit like a hack.

We expect that the issue is that the order of the parameters are cached somewhere in the client, and then when the underlying stored procedure is updated, the cache isn't invalidated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions