Skip to content

[Bug] Fix bug that modification of global variable can not be persisted. - #4324

Merged
morningman merged 3 commits into
apache:masterfrom
morningman:persist_global_var
Aug 18, 2020
Merged

[Bug] Fix bug that modification of global variable can not be persisted.#4324
morningman merged 3 commits into
apache:masterfrom
morningman:persist_global_var

Conversation

@morningman

@morningmanmorningman commented Aug 11, 2020

Copy link
Copy Markdown
Contributor

Proposed changes

When setting global variables, such as set global default_rowset_type=beta,
the operation is not correctly persisted.

This CL change the fe meta version to 90.


The main reason for this problem is that for the modification of global variable,
we directly use Java's reflection mechanism to modify static member variables in GlobalVariable class.

But in the persistence method of the set operation, we only persist the value stored
in the globalSessionVariable variable, and this variable does not contain Global Variable.

So I added a new OperationType: OP_GLOBAL_VARIABLE_V2,
and added a GlobalVarPersistInfo class to record all changes.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

@morningmanmorningman added kind/fix Categorizes issue or PR as related to a bug. kind/meta-version-change Categorizes issue or PR as related to changing meta version labels Aug 11, 2020
@morningmanmorningman self-assigned this Aug 11, 2020

@EmmyMiao87EmmyMiao87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@morningmanmorningman added the approved Indicates a PR has been approved by one committer. label Aug 17, 2020
@morningman
morningman merged commit 38a2a7a into apache:masterAug 18, 2020
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Aug 21, 2020
…ed. (apache#4324)
When setting global variables, such as `set global default_rowset_type=beta`,
the operation is not correctly persisted.
This CL change the fe meta version to 90.
---------------
The main reason for this problem is that for the modification of global variable,
we directly use Java's reflection mechanism to modify static member variables in `GlobalVariable` class.
But in the persistence method of the `set` operation, we only persist the value stored
in the `globalSessionVariable` variable, and this variable does not contain Global Variable.
So I added a new OperationType: `OP_GLOBAL_VARIABLE_V2`,
and added a `GlobalVarPersistInfo` class to record all changes.
@yangzhgyangzhg mentioned this pull request Feb 9, 2021
Hastyshell added a commit to Hastyshell/doris that referenced this pull request Sep 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.kind/fixCategorizes issue or PR as related to a bug.kind/meta-version-changeCategorizes issue or PR as related to changing meta version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Modification of global variables is not correctly persisted.

3 participants

@morningman@EmmyMiao87@morningman-cmy