-
Notifications
You must be signed in to change notification settings - Fork 306
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
Added implicit PRUNE mode warning & Handling invalid data-storage-mode file #8369
Conversation
CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ | |||
- Next release will introduce a breaking change to Teku's metrics. This is due to some metrics changing names after a library upgrade. | |||
We recommend all users of the `Teku - Detailed` dashboard to upgrade to version [Revision 12](https://grafana.com/api/dashboards/16737/revisions/12/download) | |||
as soon as possible. Documentation with all metrics that have been renamed will be provided. | |||
- Next release will stop supporting implicit PRUNE database storage mode configuration. If you want to keep using PRUNE mode, you must update your config file or CLI options with --data-storage-mode=PRUNE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's difficult to understand. Maybe focus on default behavior changing from PRUNE to MINIMAL unless explicitely configured something else ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is specifically focussed on what we need users to do, im not sure we can make it easier to understand without saying
From the next release, you will need to explicitly set `--data-storage-mode=(prune|archive)` unless you're using minimal data-storage-mode (which is default behaviour)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your version more. Some users don't even know which mode they are using and what is the difference
print( | ||
"Prune mode being used as default without a explicit --data-storage-mode option. This will NOT be " | ||
+ "supported in future Teku versions. Please add --data-storage-mode=prune to your CLI arguments" | ||
+ " or config file.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. if you want to keep it"?
dataDirLayout.getBeaconDataDirectory().toFile().exists(), | ||
getStorageModeFromPersistedDatabase(dataDirLayout), | ||
dataStorageMode); | ||
beaconDataDirectory.toFile().exists(), storageModeFromStoredFile, dataStorageMode); | ||
} else { | ||
if (dataStorageMode.equals(NOT_SET)) { | ||
dataStorageMode = PRUNE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this, it defaults to PRUNE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If next one answer is "YES", this one is clear. Do we need to print warn here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I think I can clear this up... I don't think there is a code path where dataConfig
will ever be null. So this else should never happen in production.
|
||
if (isExistingStore) { | ||
STATUS_LOG.warnUsageOfImplicitPruneDataStorageMode(); | ||
return PRUNE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we wll change this behavior in another release, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct: #8371
} | ||
} catch (IOException e) { | ||
LOG.error("Failed to read storage mode file", e); | ||
} | ||
|
||
return maybeConfiguredStorageMode.orElse(StateStorageMode.DEFAULT_MODE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method name is getStateStorageModeFromConfigOrDisk
, but we read only for config actually and warn if persisted doesn't match. Maybe rename method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I am thinking about it, we can probably get rid of this method... There is no point in warning about this anymore as we are planning to get rid of this behaviour soon... Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we print actually used, we don't use file info here, so it makes sense (to clean it)
if (maybeStorageModeFromFile.isPresent() && maybeConfiguredStorageMode.isPresent()) { | ||
if (!maybeStorageModeFromFile.get().equals(maybeConfiguredStorageMode.get())) { | ||
LOG.info( | ||
"Storage mode that was persisted differs from the command specified option; file: {}, CLI: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to see here which one will be actually used. And maybe it should be warn
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have another log line that says what data storage mode is being used. Not sure if there is value in adding it here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this one is called on init, another one later will log actual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM check tests pls
PR Description
WARNING
In the next release, Teku will stop supporting implicit PRUNE database storage mode configuration. If you want to keep using PRUNE mode, you must update your config file or CLI options with
--data-storage-mode=PRUNE
Fixed Issue(s)
fixes #8357
Documentation
doc-change-required
label to this PR if updates are required.Changelog