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

Standalone doesn't create directory while specify data_home by env #2587

Closed
evenyag opened this issue Oct 12, 2023 · 0 comments · Fixed by #2588
Closed

Standalone doesn't create directory while specify data_home by env #2587

evenyag opened this issue Oct 12, 2023 · 0 comments · Fixed by #2588
Assignees
Labels
C-bug Category Bugs

Comments

@evenyag
Copy link
Contributor

evenyag commented Oct 12, 2023

What type of bug is this?

Unexpected error

What subsystems are affected?

Standalone mode

What happened?

The server panic if we change the data_home to a directory that does not exist

What operating system did you use?

All

Relevant log output and stack trace

2023-10-12T06:33:50.711840Z  INFO cmd::standalone: Standalone frontend options: FrontendOptions {
    mode: Standalone,
    node_id: None,
    heartbeat: HeartbeatOptions {
        interval_millis: 18000,
        retry_interval_millis: 3000,
    },
    http: HttpOptions {
        addr: "127.0.0.1:4000",
        timeout: 30s,
        disable_dashboard: false,
        body_limit: ReadableSize(
            67108864,
        ),
    },
    grpc: GrpcOptions {
        addr: "127.0.0.1:4001",
        runtime_size: 8,
        max_recv_message_size: 536870912,
        max_send_message_size: 536870912,
    },
    mysql: MysqlOptions {
        enable: true,
        addr: "127.0.0.1:4002",
        runtime_size: 2,
        tls: TlsOption {
            mode: Disable,
            cert_path: "",
            key_path: "",
        },
        reject_no_database: None,
    },
    postgres: PostgresOptions {
        enable: true,
        addr: "127.0.0.1:4003",
        runtime_size: 2,
        tls: TlsOption {
            mode: Disable,
            cert_path: "",
            key_path: "",
        },
    },
    opentsdb: OpentsdbOptions {
        enable: true,
        addr: "127.0.0.1:4242",
        runtime_size: 2,
    },
    influxdb: InfluxdbOptions {
        enable: true,
    },
    prom_store: PromStoreOptions {
        enable: true,
    },
    otlp: OtlpOptions {
        enable: true,
    },
    meta_client: None,
    logging: LoggingOptions {
        dir: "/tmp/greptimedb/logs",
        level: None,
        enable_jaeger_tracing: false,
    },
    datanode: DatanodeOptions {
        client: DatanodeClientOptions {
            timeout: 10s,
            connect_timeout: 1s,
            tcp_nodelay: true,
        },
    },
    user_provider: None,
}, datanode options: DatanodeOptions {
    mode: Standalone,
    node_id: Some(
        0,
    ),
    require_lease_before_startup: false,
    rpc_addr: "127.0.0.1:3001",
    rpc_hostname: None,
    rpc_runtime_size: 8,
    rpc_max_recv_message_size: 536870912,
    rpc_max_send_message_size: 536870912,
    heartbeat: HeartbeatOptions {
        interval_millis: 3000,
        retry_interval_millis: 3000,
    },
    http: HttpOptions {
        addr: "127.0.0.1:4000",
        timeout: 30s,
        disable_dashboard: false,
        body_limit: ReadableSize(
            67108864,
        ),
    },
    meta_client: None,
    wal: WalConfig {
        file_size: ReadableSize(
            268435456,
        ),
        purge_threshold: ReadableSize(
            4294967296,
        ),
        purge_interval: 600s,
        read_batch_size: 128,
        sync_write: false,
    },
    storage: StorageConfig {
        global_ttl: None,
        data_home: "/tmp/greptimedb2",
        store: File(
            FileConfig,
        ),
        compaction: CompactionConfig {
            max_inflight_tasks: 4,
            max_files_in_level0: 8,
            max_purge_tasks: 32,
            sst_write_buffer_size: ReadableSize(
                8388608,
            ),
        },
        manifest: RegionManifestConfig {
            checkpoint_margin: Some(
                10,
            ),
            gc_duration: Some(
                600s,
            ),
            compress: false,
        },
        flush: FlushConfig {
            max_flush_tasks: 8,
            region_write_buffer_size: ReadableSize(
                33554432,
            ),
            picker_schedule_interval: 300s,
            auto_flush_interval: 3600s,
            global_write_buffer_size: None,
        },
    },
    region_engine: [
        Mito(
            MitoConfig {
                num_workers: 1,
                worker_channel_size: 128,
                worker_request_batch_size: 64,
                manifest_checkpoint_distance: 10,
                manifest_compress_type: Uncompressed,
                max_background_jobs: 4,
                auto_flush_interval: 1800s,
                global_write_buffer_size: ReadableSize(
                    1073741824,
                ),
                global_write_buffer_reject_size: ReadableSize(
                    2147483648,
                ),
                sst_meta_cache_size: ReadableSize(
                    134217728,
                ),
                vector_cache_size: ReadableSize(
                    536870912,
                ),
            },
        ),
        File(
            EngineConfig,
        ),
    ],
    logging: LoggingOptions {
        dir: "/tmp/greptimedb/logs",
        level: None,
        enable_jaeger_tracing: false,
    },
    enable_telemetry: true,
}
2023-10-12T06:33:50.711985Z  INFO raft_engine::file_pipe_log::pipe_builder: Create raft log directory: /tmp/greptimedb2/metadata
Error: 0: Failed to start frontend, at /Users/runner/work/greptimedb/greptimedb/src/cmd/src/standalone.rs:320:10
1: Failed to open raft engine backend, at /Users/runner/work/greptimedb/greptimedb/src/frontend/src/instance.rs:276:14
2: Failed to perform raft-engine operation, at src/log-store/src/raft_engine/backend.rs:45:43
3: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })

How can we reproduce the bug?

Run

GREPTIMEDB_STANDALONE__STORAGE__DATA_HOME=/tmp/greptimedb2 ./greptime standalone start
@evenyag evenyag added the C-bug Category Bugs label Oct 12, 2023
@killme2008 killme2008 self-assigned this Oct 12, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 12, 2023
fix: ensure data_home directory created before creating metadata store, #2587
paomian pushed a commit to paomian/greptimedb that referenced this issue Oct 19, 2023
fix: ensure data_home directory created before creating metadata store, GreptimeTeam#2587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants