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

Allow setting BUCKET_DIR_PATH when starting Stellar-Core in captive mode #3437

Closed
bartekn opened this issue Mar 3, 2021 · 3 comments · Fixed by #3479
Closed

Allow setting BUCKET_DIR_PATH when starting Stellar-Core in captive mode #3437

bartekn opened this issue Mar 3, 2021 · 3 comments · Fixed by #3479

Comments

@bartekn
Copy link
Contributor

bartekn commented Mar 3, 2021

What problem does your feature solve?

Some users would like to specify where Stellar-Core stores bucket files because a default /tmp location is not always right (small partition, etc.)

What would you like to see?

A new config flag that is forwarded to Captive Stellar-Core config (both online and offline modes).

What alternatives are there?

Ideally, Stellar-Core team implements stellar/stellar-core#2942 so there is no need to store bucket files on disk.

@Shaptic
Copy link
Contributor

Shaptic commented Mar 11, 2021

According to the Golang documentation, we should be able to customize this with no changes to the codebase:

On Unix systems, it returns $TMPDIR if non-empty, else /tmp. On Windows, it uses GetTempPath, returning the first non-empty value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows directory. On Plan 9, it returns /tmp.

That means a user can customize where their Core buckets go via TMPDIR=~/.cache horizon --db-url=.... If we can document this scenario, I think that will close this issue. Thoughts @bartekn?

@bartekn
Copy link
Contributor Author

bartekn commented Mar 11, 2021

I think we should have a separate flag, even given it's configurable via TMPDIR:

  • We need users to set this value explicitly, we had at least two users who run of space because their /tmp partition was too small. So not setting TMPDIR will default to /tmp and this will cause the similar issues again.
  • TMPDIR is not descriptive enough.
  • It can affect other apps if set globally instead of per process.
  • If Consider restoring previous captive core state on startup instead of catchup stellar-core#2960 is implemented this folder will not be temporary anymore. It will be better to persist files between captive core runs because bucket files will be reused.

@Shaptic
Copy link
Contributor

Shaptic commented Mar 12, 2021

Based on our conversation with ops, here's the strategy moving forward:

  • We'll introduce a parameter (ideas: --storage-directory, --bucket-directory, --captive-core-bucket-directory; patents are pending) that will be passed along to Core's BUCKET_DIR_PATH.
  • This will be the current directory by default, in order to make it obvious that there are large chunks of data being generated and encourage users to set the parameter accordingly when they notice this.
  • Ops will set this to /var/lib/stellar in their packaging-based deployments.
  • /tmp and friends will no longer be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants