codenotary / immudb

immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history
https://immudb.io
Other
8.62k stars 343 forks source link

Setting ImmuDB embedded Store MaxKeyValue is not working #1864

Open ngurusamy opened 11 months ago

ngurusamy commented 11 months ago

What happened We are uisng ImmuDB embedded store as our local data store. The value mapped to the key more than 4Kb (approximately 1023Kb). Even though changing the maxValueLen in the options got from store.DefaultOptions() and using that options to open the store, the maxVauleLen is not changed to new value and throws the error "2023/11/08 22:25:11 max value length exceeded"

code snippet:

    **_opts := store.DefaultOptions()
    opts = opts.WithMaxValueLen(10485760)
    st, err := store.Open("dataSource", opts)_**

What you expected to happen I expect, the maxValueLen of the Store should have new value 10485760

How to reproduce it (as minimally and precisely as possible)

  1. Open embedded store with above mentioned maxValueLen set.
  2. Set the key and value of 1023Kb in the datastore.

Environment immudb: v1.5.0



**Additional info (any other context about the problem)**
jeroiraz commented 11 months ago

What happened We are uisng ImmuDB embedded store as our local data store. The value mapped to the key more than 4Kb (approximately 1023Kb). Even though changing the maxValueLen in the options got from store.DefaultOptions() and using that options to open the store, the maxVauleLen is not changed to new value and throws the error "2023/11/08 22:25:11 max value length exceeded"

code snippet:

    **_opts := store.DefaultOptions()
    opts = opts.WithMaxValueLen(10485760)
    st, err := store.Open("dataSource", opts)_**

What you expected to happen I expect, the maxValueLen of the Store should have new value 10485760

How to reproduce it (as minimally and precisely as possible)

1. Open embedded store with above mentioned maxValueLen set.

2. Set the key and value of 1023Kb in the datastore.

Environment immudb: v1.5.0


**Additional info (any other context about the problem)**

Hi @ngurusamy, currently the key length can only be effectively specified at database creation time