Files
greptimedb/tests/cases/standalone/common/ttl
916acb1267 fix(operator): apply metric ingest TTL hints to physical tables (#9057)
* fix(operator): apply metric ingest TTL to physical tables

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* fix(operator): preserve instant TTL on logical tables and add remote write TTL hint integration test

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* fix(operator): preserve instant TTL on logical tables and add remote write TTL hint integration test

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* test(sqlness): regenerate logical table TTL expectation

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* refactor(operator): centralize metric logical table TTL checks

Share retention-vs-instant TTL helpers between DDL validation, auto-create
option filling, and ingest rejection messages so batch and SQL paths stay aligned.

Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>

* fix(operator): borrow physical table name for TTL hint error

Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>

* test(sqlness): expect InvalidArguments for logical retention TTL

Align table_semantics with alter_table retention rejection and rustfmt
the TTL hint error helper call.

Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>

* feat(operator): apply retention ttl hint only on physical table creation and ignore on subsequent writes

Signed-off-by: Mohd Quamar Tyagi <104281681+Tyagiquamar@users.noreply.github.com>

* fix(operator): legacy logical TTL on create and restore ddl.rs LF

Strip retention ttl from metric logical CREATE options with a warning so
import_v2 can replay older snapshots. Narrow alter TTL checks, reduce
helper visibility, and convert ddl.rs back to LF line endings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* fix(cli): clippy in import_v2 legacy ttl test

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* docs(operator): clarify logical metric ttl alter handling

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* test(sqlness): add server-side coverage for legacy logical-table TTL

Replace the mock import_v2 unit test with sqlness cases verifying:
- SHOW CREATE TABLE omits database retention TTL on logical tables.
- Legacy logical CREATE TABLE with retention TTL strips the retention option from create_options.
- Explicit instant TTL remains preserved on logical tables.

Group TTL_KEY import in ddl.rs and verify create_options in HTTP test.

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>

* refactor(operator): strip logical retention ttl in one place

Every logical-table create path ends in StatementExecutor::create_logical_tables,
so strip retention ttl there instead of in fill_table_options_for_create and
validate_logical_create. validate_logical_create no longer mutates its input.

Classify ttl by parsing it once: only a valid non-instant ttl counts as
retention. Invalid values now fail normal option validation instead of being
silently stripped on create or reported as retention on ALTER.

Drop unit tests covered by the sqlness and HTTP integration cases.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
Signed-off-by: Mohd Quamar Tyagi <104281681+Tyagiquamar@users.noreply.github.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Dennis Zhuang <killme2008@gmail.com>
2026-11-18 23:46:22 +00:00
..