Skip to content
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

feat: make odc adapt to OceanBase 4.2 #541

Merged
merged 4 commits into from
Oct 18, 2023
Merged

Conversation

yhilmare
Copy link
Contributor

@yhilmare yhilmare commented Oct 17, 2023

What type of PR is this?

type-feature
feat-adapt to ob 4.2

What this PR does / why we need it:

this pr makes odc adapt to OceanBase 4.2. we do things in this pr as follow:

  1. add schema in generated flashback sql.

the front end will create a new session when using recyclebin so that the observer will flashback the object to the schema where the connection connect to.

To avoid flashbacking a db object to an uncertain schema, we should add schema to the generated sql.

Here is an example:

flashback table `abcd` to before drop rename to `new_name`; -- before
flashback table `abcd` to before drop rename to `schema`.`new_name`; -- after
  1. refactor the pojo object's (TraceSpan) structure of full-link trace and convert the field tags's type from List<Map<String, Object>> to List<Object>.

we will get the json string on OceanBase 4.1 when show trace format='json' is executed:

[
    {
        "logs": null,
        "tags": [
           ...
            {
                "log_trace_id": "Y2F170BA2D939-000602A2DA7F897E-0-0"
            }
        ],
        ...

we do the same thing on OceanBase 4.2.1 and get a json string as follow:

[
    {
        "logs": null,
        "tags": [
            [
                ...
                {
                    "log_trace_id": "Y2FB70BA2D939-000608DF99AE2C76-0-0"
                }
            ]
        ],
       ...

as you can see: the structure of the json has been changed, and that is why the full-link trace does not work on OceanBase 4.2.

I change the structure of the pojo object and find another way to avoid this change.

Which issue(s) this PR fixes:

Fixes #94 #506

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@yhilmare yhilmare added type-feature The functionality to be implemented feat-adapt to ob4.2 labels Oct 17, 2023
@yhilmare yhilmare added this to the ODC 4.2.2 milestone Oct 17, 2023
@yhilmare yhilmare self-assigned this Oct 17, 2023
@yhilmare yhilmare linked an issue Oct 18, 2023 that may be closed by this pull request
Copy link
Contributor

@smallsheeeep smallsheeeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yhilmare yhilmare merged commit 985d786 into dev/4.2.2 Oct 18, 2023
19 checks passed
@yhilmare yhilmare deleted the feat/shanlu_adapt_to_ob42x branch October 18, 2023 02:59
yhilmare added a commit that referenced this pull request Jan 15, 2024
* feat: make odc apapt to OceanBase 4.2.1

* update submodule

* response to comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat-adapt to ob4.2 type-feature The functionality to be implemented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: no traceId on OceanBase 4.2
2 participants