Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(clustering): ensure data plane config hash is never nil
The previous logic defaulted the config_hash to nil when it was detected to be an empty string. This can cause update_sync_status() to fail, because config_hash is a required attribute: > 2023/11/03 17:13:30 [debug] 4052224#0: *150 [lua] connector.lua:560: execute(): SQL query throw error: ERROR: null value in column "config_hash" of relation "clustering_data_planes" violates not-null constraint > Failing row contains (4fb29006-8db1-48bb-b68c-34b582e1d91a, soup, 127.0.0.1, 2023-11-04 00:13:30+00, null, 2023-11-18 00:13:30.799+00, 3.6.0, filter_set_incompatible, 2023-11-04 00:13:30+00, {})., close connection > 2023/11/03 17:13:30 [notice] 4052224#0: *150 [lua] init.lua:275: upsert(): ERROR: null value in column "config_hash" of relation "clustering_data_planes" violates not-null constraint This change addresses the problem from two angles: 1. when empty, config_hash is set to the default DECLARATIVE_EMPTY_CONFIG_HASH constant instead of nil 2. an additional guard was added to the dp reader thread, which checks the length of ping frame data and returns an error if it is not a proper config hash
- Loading branch information