Skip to content

Getting "Access is denied" for WAL files in Windows #954

Open
@primez

Description

@primez

Hello,

First of all, thank you for creating such an interesting database.
I tried to use it in my application on Windows and it keeps throwing errors related to WAL files, e.g:

  • level=error db=logs_db msg="failed to delete old segment" baseIndex=1 id=2 err="sync D:\Temp\frostdb\databases\logs_db\wal: Access is denied."
  • err="failed initializing meta DB: sync D:\Temp\frostdb\databases\logs_db\wal: Access is denied."

It works just fine in Windows WSL2 though.

Here is an initialization excerpt

      // Create a registry for metrics
	registry := prometheus.NewRegistry()

	// Configure index levels with parquet disk compaction for better performance
	indexConfig := []*index.LevelConfig{
		{
			Level:   index.L0,
			MaxSize: 100 * frostdb.MiB,
			Type:    index.CompactionTypeParquetDisk,
		},
		{
			Level:   index.L1,
			MaxSize: 200 * frostdb.MiB,
			Type:    index.CompactionTypeParquetDisk,
		},
		{
			Level:   index.L2,
			MaxSize: 500 * frostdb.MiB,
		},
	}

	// Create column store with Windows-friendly options
	fmt.Println("Creating column store...")
	var columnstore, err = frostdb.New(
		frostdb.WithLogger(logger),
		frostdb.WithWAL(),
		frostdb.WithStoragePath(storagePathDir),
		frostdb.WithActiveMemorySize(100*frostdb.MiB),
		frostdb.WithRegistry(registry),
		frostdb.WithIndexConfig(indexConfig),
		frostdb.WithSnapshotTriggerSize(100*frostdb.MiB),
	)
	if err != nil {
		log.Fatalf("Failed to create column store: %v", err)
	}

	// Defer close and handle potential errors
	defer func() {
		if closeErr := columnstore.Close(); closeErr != nil {
			log.Printf("Warning: Error during column store close: %v", closeErr)
		}
	}()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions