-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
type/docsThis PR mainly updates/creates documentationThis PR mainly updates/creates documentation
Description
- Gitea version (or commit ref): 1.13.1 (and also master as of 8688c2b)
- Git version: NA
- Operating system: docker
- Database (use
[x]
): NA - Can you reproduce the bug at https://try.gitea.io: NA
- Log gist: NA
Description
It seems ISSUE_INDEXER_QUEUE_CONN_STR
is being used as ISSUE_INDEXER_QUEUE_DIR
.
Steps to reproduce (from source):
- set this in app.ini (and some sane values for the other ini sections):
[indexer]
ISSUE_INDEXER_TYPE = bleve
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
- start gitea web (this one was compiled from source as of 8688c2b):
/data $ GITEA_WORK_DIR=/data/gitea ~/Downloads/gitea/gitea web --config /data/gitea/conf/app.ini
- Notice
issues.queue
is created, as per the defaults:
/data $ tree gitea/indexers/
gitea/indexers/
├── issues.bleve
│ ├── index_meta.json
│ ├── rupture_meta.json
│ └── store
└── issues.queue
├── 000002.ldb
├── 000003.log
├── CURRENT
├── CURRENT.bak
├── LOCK
├── LOG
└── MANIFEST-000004
- stop gitea
rm -r /data/gitea/indexers/
- change the indexer config section to
[indexer]
ISSUE_INDEXER_TYPE = bleve
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
-
start gitea web again
-
notice that
issues.queue
does not exist, but a 'addrs=127.0.0.1:6379 db=0' dir was created:
/data $ tree gitea/indexers/
gitea/indexers/
└── issues.bleve
├── index_meta.json
├── rupture_meta.json
└── store
1 directory, 3 files
/data $ ls
'addrs=127.0.0.1:6379 db=0' git gitea
/data $ ls addrs\=127.0.0.1\:6379\ db\=0/
000001.log CURRENT LOCK LOG MANIFEST-000000
Notice I did not set ISSUE_INDEXER_QUEUE_TYPE
nor ISSUE_INDEXER_QUEUE_DIR
anywhere.
The config-cheat-sheet does mention that ISSUE_INDEXER_QUEUE_TYPE
and ISSUE_INDEXER_QUEUE_DIR
are deprecated, but they are present in the example config file:
gitea/custom/conf/app.example.ini
Lines 453 to 460 in 3c96a37
ISSUE_INDEXER_QUEUE_TYPE = levelqueue | |
; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path, | |
; default is indexers/issues.queue | |
ISSUE_INDEXER_QUEUE_DIR = indexers/issues.queue | |
; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string. | |
ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0" | |
; Batch queue number, default is 20 | |
ISSUE_INDEXER_QUEUE_BATCH_NUMBER = 20 |
I was able to reproduce this using:
- gitea 1.13.1, docker, sqlite
- gitea 1.13.1, Gentoo, MySQL (production install)
- master as of 8688c2b), Ubuntu 18, sqlite
Screenshots
NA
Metadata
Metadata
Assignees
Labels
type/docsThis PR mainly updates/creates documentationThis PR mainly updates/creates documentation
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
zeripath commentedon Jan 6, 2021
this is intentional.
nuno-silva commentedon Jan 6, 2021
What's the reasoning behind this being intentional? Shouldn't
ISSUE_INDEXER_QUEUE_CONN_STR
only do anything at all whenISSUE_INDEXER_QUEUE_TYPE
isredis
?nuno-silva commentedon Jan 7, 2021
CONN_STR
in thequeue
section is also affected (this is from a prod instance running 1.13.1):...and if I comment out
CONN_STR
and restart gitea:Note that it's not hard to end up with
CONN_STR
defined even if not using redis, since that's how it's done in the example config:gitea/custom/conf/app.example.ini
Lines 484 to 497 in 3c96a37
So, if this is intentional, it should at least be documented :/
zeripath commentedon Jan 7, 2021
because it can be used to provide a lot more options to the leveldb queue.
The app.example.ini is NOT supposed to be copied. If you don't know what a setting is you should not set it.
nuno-silva commentedon Jan 7, 2021
sorry to insist, but...
Fair enough. I can simply not define
CONN_STR
norISSUE_INDEXER_QUEUE_CONN_STR
. However, it is not mentioned anywhere in the config-cheat-sheet nor in the example config that the directory settings are overridden by these unrelated "connection" settings. This "intentional behaviour" is totally unexpected and should at least be documented, even if done for legacy/compatibility reasons.sure, but why should it override the directory when leveldb is not used?
zeripath commentedon Jan 9, 2021
They are not unrelated settings at all. Just because you don't know how they relate does not mean that they aren't and aren't that way for a good reason.
How do you think the persistable-channel is persisted? We use a leveldb internally - I'm fairly certain that the docs state that.
Anyway let's stop being so aggressive.
The CONN_STR for an underlying level db is a directory or, something of the form:
leveldb://path/to/db?option=value&....
orleveldb:///absolute/path/to/db?option=value&....
with options as per:
gitea/modules/nosql/manager_leveldb.go
Lines 59 to 132 in d989247
I'm sorry it's incompletely documented but it's the only way to allow any of these options to be set.
I don't completely understand how can we be expected that you would have incorrect values in your app.ini. However, feel free to provide a PR improving the documentation.
If you don't understand what is in your app.ini please don't set it. Please go through the rest of your app.ini - I suspect you have a section
[log.x]
that does nothing amongst lots of other unhelpful logging configuration - https://docs.gitea.io/en-us/logging-configuration may be helpful.nuno-silva commentedon Jan 10, 2021
Thanks for clearing that up. It makes a bit more sense now that you explained it.
I'm sorry if I was aggressive.
Sorry, I can't find it anywhere :/
Anyway, I think it's clear now that this is a documentation issue.
I'll try to open a PR (probably next week) to improve the docs and the example config to make this a bit more clear.
yep, you're right :/ I'll review my config. Thank you.
Update docs to clarify issues raised in go-gitea#14272
Update docs to clarify issues raised in #14272 (#14318)
Merge branch 'master' into imap