On Sat, 2021-05-08 at 11:05 -0700, tgulacsi78 wrote:
> blobpacked has a SetRecovery (in latest Perkeep), but I don't see a
> mode to set it.
> The easiest would be the following patch, then `go install
> ./server/perkeepd` and then `env RECOVERY=1 perkeepd` or `env
> RECOVERY=2 perkeepd`.
>
> diff --git a/pkg/blobserver/blobpacked/blobpacked.go
> b/pkg/blobserver/blobpacked/blobpacked.go
> index 7fc364fc7..f401c0f15 100644
> --- a/pkg/blobserver/blobpacked/blobpacked.go
> +++ b/pkg/blobserver/blobpacked/blobpacked.go
> @@ -163,6 +163,11 @@ var (
>         recoveryMu sync.Mutex
>         recovery   = NoRecovery
>  )
> +func init() {
> +       if n, err := strconv.Atoi(os.Getenv("RECOVERY")); err == nil
> && n != 0 {
> +               SetRecovery(RecoveryMode(n))
> +       }
> +}
>
>  // TODO(mpl): make SetRecovery a method of type storage if we ever
> export it.

This is set by the recovery flag here,
https://github.com/perkeep/perkeep/blob/dd14e9ea063054c9230218c2311cea15ba7f9284/server/perkeepd/perkeepd.go#L364-L371

The output that I showed (I should have posted this) comes from running
camlistored with recover=2 and reindex=true.

```
$ bin/camlistored -recovery 2 -reindex
2021/05/08 21:17:54 Starting camlistored version 2016-09-27-3e1edc1; Go
go1.7.1 (linux/amd64)
2021/05/08 21:17:54 TLS enabled, with SHA-256 certificate fingerprint:
7a8f78061f778fd50889
2021/05/08 21:17:54 Starting to listen on https://localhost:3179
2021/05/08 21:17:54 Caught panic installer handlers: error
instantiating handler for prefix "/sync/", type "sync": error from
"leveldb" KeyValue: leveldb: manifest corrupted (field 'comparer'):
missing [file=MANIFEST-000283]
goroutine 1 [running]:
runtime/debug.Stack(0xc420056050, 0x2, 0xc4209c5450)
        /home/user/go/src/runtime/debug/stack.go:24 +0x79
runtime/debug.PrintStack()
        /home/user/go/src/runtime/debug/stack.go:16 +0x22
camlistore.org/pkg/serverinit.(*Config).InstallHandlers.func1(0xc420251
bc0)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:525 +0xa8
panic(0xcced60, 0xc42046cd60)
        /home/user/go/src/runtime/panic.go:458 +0x243
camlistore.org/pkg/serverinit.(*handlerLoader).setupHandler.func1(0xc42
0115950, 0xc42007fd80, 0xe35f06, 0x6)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:307 +0x1b4
panic(0xcced60, 0xc42046cd60)
        /home/user/go/src/runtime/panic.go:458 +0x243
camlistore.org/pkg/serverinit.exitFailure(0xe65459, 0x36, 0xc420251630,
0x3, 0x3)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:276 +0xef
camlistore.org/pkg/serverinit.(*handlerLoader).setupHandler(0xc42007fd8
0, 0xe35f06, 0x6)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:368 +0x1272
camlistore.org/pkg/serverinit.(*handlerLoader).setupAll(0xc42007fd80)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:230 +0x9a
camlistore.org/pkg/serverinit.(*Config).InstallHandlers(0xc420278fc0,
0x14f7e80, 0xc42007f000, 0xc420477c40, 0x16, 0x0, 0x0, 0x0, 0x0, 0x0,
...)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/pkg/serverinit/serverinit.go:591 +0x451
main.Main(0x0, 0x0)
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/server/camlistored/camlistored.go:421
+0x5d3
main.main()
        /home/user/src/camlistore.org/tmp/build-gopath-
nosqlite/src/camlistore.org/server/camlistored/camlistored.go:354 +0x33
Error parsing config: Caught panic: error instantiating handler for
prefix "/sync/", type "sync": error from "leveldb" KeyValue: leveldb:
manifest corrupted (field 'comparer'): missing [file=MANIFEST-000283]
```


-- 
You received this message because you are subscribed to the Google Groups 
"Perkeep" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/perkeep/f8608748904de9f07c534e7f6306dcf6c7051438.camel%40kortschak.io.

Reply via email to