Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/scripts/native-sql-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Execute fresh schemas and the complete released-2.7.1 upgrade on native engines."""
"""Execute fresh schemas and the upgrade chain from released-2.7.1 on native engines."""

import argparse
import json
Expand All @@ -25,6 +25,9 @@
from pathlib import Path

BASELINE = "218c5634ebffb1f0ce7e8ea921b85cd5a633cde7" # v2.7.1, peeled commit
# Upgrade scripts applied in order on top of the BASELINE schema, newest last.
# Adding a released migration here keeps every ALTER/DROP gated on real engines.
MIGRATIONS_FROM_BASELINE = ("2.7.1-upgrade-2.7.2", "2.7.2-upgrade-2.7.3")
PASSWORD = "SqlMatrix@2026"
SENTINEL = "sql-matrix-plugin"
JAR_HEX = "0001027fff"
Expand Down Expand Up @@ -466,8 +469,9 @@ def execute_matrix(dialect, root, output):
before = {table: set(engine.sql("SELECT id FROM " + engine.table(table) + ";").split()) for table in TABLES}
if flow == "upgrade":
engine.insert_data_permissions(duplicates=True)
migration = root / f"db/upgrade/2.7.1-upgrade-2.7.2-{dialect}.sql"
engine.sql(migration.read_text(encoding="utf-8"))
for step in MIGRATIONS_FROM_BASELINE:
migration = root / f"db/upgrade/{step}-{dialect}.sql"
engine.sql(migration.read_text(encoding="utf-8"))
else:
engine.insert_data_permissions()
engine.check_data(listing, detail)
Expand Down
14 changes: 14 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@

### Behavior Changes

- The misspelled `loged` column of the `selector` and `rule` tables is renamed
to `logged`, together with the matching fields of the Admin REST DTOs/VOs
(`SelectorDTO`, `RuleDTO`, `SelectorVO`, `RuleVO`) and the gateway-side
`RuleData`. Existing deployments must run the `2.7.2-upgrade-2.7.3-*.sql`
script for their database dialect (MySQL, PostgreSQL, Oracle, openGauss,
OceanBase) before upgrading. Upgrade order matters: the field is part of the
admin-to-bootstrap sync contract, so upgrade all bootstrap instances before,
or together with, admin — a new admin emitting `logged` is not understood by
old bootstraps, and that direction cannot be tolerated in code. For one release the Admin REST layer keeps
accepting the old `loged` request field via a JSON alias, but responses
always use `logged`; stored rate-limiter handle JSON keeps parsing the old
`loged` key via a Gson alternate. REST API clients that read `loged` from
responses must switch to `logged`. (#7589)

- HTTP client registration now treats non-success Admin responses as failures,
using the same bounded failback policy as transport errors (18 retry attempts
per pending task). The text response contract does not reliably distinguish
Expand Down
6 changes: 3 additions & 3 deletions db/init/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ CREATE TABLE `rule` (
`match_mode` int(0) NOT NULL COMMENT 'matching mode (0 and 1 or)',
`rule_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'rule name',
`enabled` tinyint(0) NOT NULL COMMENT 'whether to open (0 close, 1 open) ',
`loged` tinyint(0) NOT NULL COMMENT 'whether to log or not (0 no print, 1 print) ',
`logged` tinyint(0) NOT NULL COMMENT 'whether to log or not (0 no print, 1 print) ',
`match_restful` tinyint(0) NOT NULL COMMENT 'whether to match restful(0 cache, 1 not cache)',
`namespace_id` varchar(50) NOT NULL COMMENT 'namespace id',
`sort_code` int(0) NOT NULL COMMENT 'sort',
Expand Down Expand Up @@ -1789,7 +1789,7 @@ CREATE TABLE `selector` (
`sort_code` int(0) NOT NULL COMMENT 'sort',
`handle` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'processing logic (here for different plug-ins, there will be different fields to identify different processes, all data in JSON format is stored)',
`enabled` tinyint(0) NOT NULL COMMENT 'whether to open (0 close, 1 open) ',
`loged` tinyint(0) NOT NULL COMMENT 'whether to print the log (0 no print, 1 print) ',
`logged` tinyint(0) NOT NULL COMMENT 'whether to print the log (0 no print, 1 print) ',
`continued` tinyint(0) NOT NULL COMMENT 'whether to continue execution',
`match_restful` tinyint(0) NOT NULL COMMENT 'whether to match restful(0 cache, 1 not cache)',
`namespace_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'namespace id',
Expand Down Expand Up @@ -2364,7 +2364,7 @@ CREATE TABLE IF NOT EXISTS `namespace_user_rel` (
`date_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'date_updated'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='namespace user relation ';

INSERT INTO `selector` (`id`, `plugin_id`, `selector_name`, `match_mode`, `selector_type`, `sort_code`, `handle`, `enabled`, `loged`, `continued`, `match_restful`, `namespace_id`) VALUES ('1913785244204204032', '61', 'mcpServer', 0, 0, 1, NULL, 1, 1, 1, 0, '649330b6-c2d7-4edc-be8e-8a54df9eb385');
INSERT INTO `selector` (`id`, `plugin_id`, `selector_name`, `match_mode`, `selector_type`, `sort_code`, `handle`, `enabled`, `logged`, `continued`, `match_restful`, `namespace_id`) VALUES ('1913785244204204032', '61', 'mcpServer', 0, 0, 1, NULL, 1, 1, 1, 0, '649330b6-c2d7-4edc-be8e-8a54df9eb385');

DROP TABLE IF EXISTS `instance_info`;

Expand Down
8 changes: 4 additions & 4 deletions db/init/oracle/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ create table selector
sort_code NUMBER(10) not null,
handle VARCHAR2(1024),
enabled NUMBER(3) not null,
loged NUMBER(3) not null,
logged NUMBER(3) not null,
continued NUMBER(3) not null,
match_restful NUMBER(3) not null,
namespace_id VARCHAR2(50) not null,
Expand All @@ -148,7 +148,7 @@ comment on column SELECTOR.handle
is 'processing logic (here for different plugins, there will be different fields to identify different processes, all data in JSON format is stored)';
comment on column SELECTOR.enabled
is 'whether to open (0 not open, 1 open)';
comment on column SELECTOR.loged
comment on column SELECTOR.logged
is 'whether to print the log (0 not print, 1 print)';
comment on column SELECTOR.continued
is 'whether to continue execution';
Expand Down Expand Up @@ -198,7 +198,7 @@ create table rule
match_mode NUMBER(10) not null,
rule_name VARCHAR2(128) not null,
enabled NUMBER(3) not null,
loged NUMBER(3) not null,
logged NUMBER(3) not null,
match_restful NUMBER(3) not null,
namespace_id VARCHAR2(50) not null,
sort_code NUMBER(10) not null,
Expand All @@ -217,7 +217,7 @@ comment on column RULE.rule_name
is 'rule name';
comment on column RULE.enabled
is 'whether to open (0 not open, 1 open)';
comment on column RULE.loged
comment on column RULE.logged
is 'whether to log or not (0 not print, 1 print)';
comment on column RULE.match_restful
is 'whether to match restful(0 cache, 1 not cache)';
Expand Down
8 changes: 4 additions & 4 deletions db/init/pg/create-table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ CREATE TABLE "public"."rule" (
"match_mode" int4 NOT NULL,
"rule_name" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
"enabled" int2 NOT NULL,
"loged" int2 NOT NULL,
"logged" int2 NOT NULL,
"match_restful" int2 NOT NULL,
"namespace_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"sort_code" int4 NOT NULL,
Expand All @@ -1699,7 +1699,7 @@ COMMENT ON COLUMN "public"."rule"."selector_id" IS 'selector id';
COMMENT ON COLUMN "public"."rule"."match_mode" IS 'matching mode (0 and 1 or)';
COMMENT ON COLUMN "public"."rule"."rule_name" IS 'rule name';
COMMENT ON COLUMN "public"."rule"."enabled" IS 'whether to open (0 close, 1 open) ';
COMMENT ON COLUMN "public"."rule"."loged" IS 'whether to log or not (0 no print, 1 print) ';
COMMENT ON COLUMN "public"."rule"."logged" IS 'whether to log or not (0 no print, 1 print) ';
COMMENT ON COLUMN "public"."rule"."match_restful" IS 'whether to match restful(0 cache, 1 not cache)';
COMMENT ON COLUMN "public"."rule"."namespace_id" IS 'namespace id';
COMMENT ON COLUMN "public"."rule"."sort_code" IS 'sort';
Expand Down Expand Up @@ -1752,7 +1752,7 @@ CREATE TABLE "public"."selector" (
"sort_code" int4 NOT NULL,
"handle" varchar(1024) COLLATE "pg_catalog"."default",
"enabled" int2 NOT NULL,
"loged" int2 NOT NULL,
"logged" int2 NOT NULL,
"continued" int2 NOT NULL,
"match_restful" int2 NOT NULL,
"namespace_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
Expand All @@ -1768,7 +1768,7 @@ COMMENT ON COLUMN "public"."selector"."selector_type" IS 'type (0, full flow, 1
COMMENT ON COLUMN "public"."selector"."sort_code" IS 'sort';
COMMENT ON COLUMN "public"."selector"."handle" IS 'processing logic (here for different plug-ins, there will be different fields to identify different processes, all data in JSON format is stored)';
COMMENT ON COLUMN "public"."selector"."enabled" IS 'whether to open (0 close, 1 open) ';
COMMENT ON COLUMN "public"."selector"."loged" IS 'whether to print the log (0 no print, 1 print) ';
COMMENT ON COLUMN "public"."selector"."logged" IS 'whether to print the log (0 no print, 1 print) ';
COMMENT ON COLUMN "public"."selector"."continued" IS 'whether to continue execution';
COMMENT ON COLUMN "public"."selector"."match_restful" IS 'whether to match restful(0 cache, 1 not cache)';
COMMENT ON COLUMN "public"."selector"."namespace_id" IS 'namespace id';
Expand Down
19 changes: 19 additions & 0 deletions db/upgrade/2.7.2-upgrade-2.7.3-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- this file works for MySQL.
ALTER TABLE `selector` RENAME COLUMN `loged` TO `logged`;
ALTER TABLE `rule` RENAME COLUMN `loged` TO `logged`;
19 changes: 19 additions & 0 deletions db/upgrade/2.7.2-upgrade-2.7.3-ob.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- this file works for OceanBase (MySQL mode).
ALTER TABLE `selector` RENAME COLUMN `loged` TO `logged`;
ALTER TABLE `rule` RENAME COLUMN `loged` TO `logged`;
19 changes: 19 additions & 0 deletions db/upgrade/2.7.2-upgrade-2.7.3-og.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- this file works for openGauss.
ALTER TABLE "public"."selector" RENAME COLUMN "loged" TO "logged";
ALTER TABLE "public"."rule" RENAME COLUMN "loged" TO "logged";
19 changes: 19 additions & 0 deletions db/upgrade/2.7.2-upgrade-2.7.3-oracle.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- this file works for Oracle.
ALTER TABLE selector RENAME COLUMN loged TO logged;
ALTER TABLE rule RENAME COLUMN loged TO logged;
19 changes: 19 additions & 0 deletions db/upgrade/2.7.2-upgrade-2.7.3-pg.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- this file works for PostgreSQL.
ALTER TABLE "public"."selector" RENAME COLUMN "loged" TO "logged";
ALTER TABLE "public"."rule" RENAME COLUMN "loged" TO "logged";
23 changes: 23 additions & 0 deletions db/upgrade/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@

## To Shenyu Users

### `loged` column renamed to `logged` in 2.7.3

Running the `2.7.2-upgrade-2.7.3-<dialect>.sql` script is mandatory for every
existing deployment: it renames the misspelled `loged` column to `logged` on
both the `selector` and `rule` tables, and the new Admin expects `logged`.
Upgrade order matters — the field is part of the Admin-to-bootstrap sync
contract. Upgrade all bootstrap instances before, or together with, Admin:
an Admin emitting `logged` is not understood by older bootstraps. Stop Admin
instances before running the script, then restart them after it completes.
Fresh installations create the renamed columns directly.

- 2.7.2-upgrade-2.7.3-mysql.sql

- 2.7.2-upgrade-2.7.3-ob.sql

- 2.7.2-upgrade-2.7.3-og.sql

- 2.7.2-upgrade-2.7.3-oracle.sql

- 2.7.2-upgrade-2.7.3-pg.sql

> this file is the Shenyu upgrade sql from v2.7.2 to v2.7.3

### Data permission uniqueness in 2.7.2

Stop Admin instances before running the `2.7.1-upgrade-2.7.2-<dialect>.sql`
Expand Down
4 changes: 2 additions & 2 deletions shenyu-admin/src/http/http-debug-rule-controller-api.http
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiw
"name": "test-create-rule",
"matchMode": 1,
"sort": 1,
"loged": true,
"logged": true,
"enabled": true,
"ruleConditions": [
{
Expand All @@ -93,7 +93,7 @@ X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiw
"name": "test-create-rule",
"matchMode": 1,
"sort": 1,
"loged": true,
"logged": true,
"enabled": true,
"ruleConditions": [
{
Expand Down
4 changes: 2 additions & 2 deletions shenyu-admin/src/http/http-debug-selector-controller-api.http
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiw
"type": 1,
"sort": 1,
"matchMode": 1,
"loged": true,
"logged": true,
"enabled": true,
"continued": true,
"selectorConditions": [
Expand All @@ -101,7 +101,7 @@ X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiw
"name": "test-create-selector",
"type": 0,
"sort": 1,
"loged": true,
"logged": true,
"enabled": true,
"continued": true,
"selectorConditions": [
Expand Down
Loading
Loading